DB2 Version 9.7 for Linux, UNIX, and Windows

TYPE_ID scalar function

Read syntax diagramSkip visual syntax diagram
>>-TYPE_ID--(--expression--)-----------------------------------><

The schema is SYSIBM.

The TYPE_ID function returns the internal type identifier of the dynamic data type of the expression.

The argument must be a user-defined structured type. (This function cannot be used as a source function when creating a user-defined function. Because it accepts any structured data type as an argument, it is not necessary to create additional signatures to support different user-defined types.)

The data type of the result of the function is INTEGER. If expression can be null, the result can be null; if expression is null, the result is the null value.

The value returned by the TYPE_ID function is not portable across databases. The value may be different, even though the type schema and type name of the dynamic data type are the same. When coding for portability, use the TYPE_SCHEMA and TYPE_NAME functions to determine the type schema and type name.

Examples: