SQL Data Types

UDF declarations support only certain SQL data types.

You can use the following SQL data types in a UDF declaration, either as data types for arguments to a UDF, or as return-value data types:

Unsupported Data Types

You cannot use the following SQL data types in a UDF declaration, either as data types for arguments to a UDF, or as return-value data types:

  • BIT – should typically be handled in the UDF declaration as a TINYINT data type, and then the implicit data type conversion from BIT automatically handles the value translation.

  • DECIMAL(<precision>, <scale>) or NUMERIC(<precision>, <scale>) – depending on the usage, DECIMAL is typically handled as a DOUBLE data type, but various conventions may be imposed to enable the use of INT or BIGINT data types.

  • LONG VARCHAR (CLOB) – supported only as an input argument, not as a return-value data type.

  • LONG BINARY (BLOB) – supported only as an input argument, not as a return-value data type.

  • TEXT – not currently supported.

Related concepts
User-Defined Function Restrictions
Maintenance of User-Defined Functions
Compiling and Linking Source Code to Build Dynamically Linkable Libraries
Related tasks
Creating a User-Defined Function
Calling User-Defined Functions
Setting the Dynamic Library Interface
Dropping User-Defined Functions
Granting and Revoking Permissions
Using Microsoft Visual Studio Debugger for User-Defined Functions