Skip to main content

ROUTINE_COLUMNS

Preview

This feature is in Public Preview.

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 11.3 LTS and above check marked yes Unity Catalog only

INFORMATION_SCHEMA.ROUTINE_COLUMNS lists the result columns of table valued functions within the catalog.

The rows returned are limited to the routines the user is privileged to interact with.

This relation is an extension to the SQL standard information schema.

Definition

The ROUTINE_COLUMNS relation contains the following columns:

NameData typeNullableDescription
SPECIFIC_CATALOGSTRINGNoCatalog containing the routine.
SPECIFIC_SCHEMASTRINGNoDatabase (schema) containing the routine.
SPECIFIC_NAMESTRINGNoSchema unique (specific) name of the routine.
ORDINAL_POSITIONINTEGERNoThe position (1-based) of the column in the result column list.
COLUMN_NAMESTRINGYesName of the column, NULL if unnamed.
DATA_TYPESTRINGNoThe parameter data type name.
FULL_DATA_TYPESTRINGNoThe parameter data type definition, for example 'DECIMAL(10, 4)'.
CHARACTER_MAXIMUM_LENGTHINTEGERYesAlways NULL, reserved for future use.
CHARACTER_OCTET_LENGTHSTRINGYesAlways NULL, reserved for future use.
NUMERIC_PRECISIONINTEGERYesFor base-2 integral numeric types, FLOAT, and DOUBLE, the number of supported bits. For DECIMAL the number of digits, NULL otherwise.
NUMERIC_PRECISION_RADIXINTEGERNoFor DECIMAL 10, for all other numeric types 2, NULL otherwise.
NUMERIC_SCALEINTEGERYesFor integral numeric types 0, for DECIMAL the number of digits to the right of the decimal point, NULL otherwise.
DATETIME_PRECISIONINTEGERYesFor DATE 0, for TIMESTAMP, and INTERVALSECOND 3, any other INTERVAL 0, NULL otherwise.
INTERVAL_TYPESTRINGYesFor INTERVAL the unit portion of the interval, e.g. 'YEAR TO MONTH', NULL otherwise.
INTERVAL_PRECISIONINTERALYesAlways NULL, reserved for future use.
MAXIMUM_CARDINALITYINTEGERYesAlways NULL, reserved for future use.
PARAMETER_DEFAULTSTRINGYesAlways NULL, reserved for future use.
COMMENTSTRINGYesAn optional comment describing the result column.

Constraints

The following constraints apply to the ROUTINE_COLUMNS relation:

ClassNameColumn ListDescription
Primary keyRTN_COLS_PKSPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, ORDINAL_POSITIONUniquely identifies the result column.
Foreign keyRTN_COLS_ROUTINES_FKSPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAMEReferences ROUTINES

Examples

SQL
> SELECT column_name, data_type
FROM information_schema.routine_columns
WHERE specific_schema = 'default'
AND specific_name = 'foo'
ORDER BY ordinal_position;