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, this 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 – Not currently supported.

  • LONG BINARY – Not currently supported.

  • TEXT – Not currently supported.

Related concepts
Creating user-defined functions
User-defined function restrictions
Compile and link switches for building dynamically linkable libraries
Related tasks
Calling user-defined functions
Dropping user-defined functions
Granting and revoking permissions


Created November 2, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com