User-Defined Functions: Large Object Input Parameter Support

User-defined functions (UDF) support the large object data types LONG VARCHAR (CLOB) and LONG BINARY (BLOB) as input parameters.

Scalar and aggregate user-defined functions support large object (LOB) data types LONG VARCHAR (CLOB) and LONG BINARY (BLOB) up to 4GB (gigabytes) as input parameters. LOB data types are not supported as output parameters.

To use LOB data types as input parameters with an existing user-defined function, drop and re-create the function, declaring a LOB data type as an input parameter.

You need not rebuild or recompile an existing user-defined function to use a LOB data type as an input parameter, if the function contains a loop that reads pieces of the value via the get_value() and get_piece() methods. The loop continues until remain_len > 0 or until 4GB is reached.

The new sample UDF my_byte_length.cxx measures the size of a column by streaming the data in piece by piece using get_piece(), then returns the size of the column in bytes. This method ensures that all of the data is read.

Note: Large object data support requires a separately licensed Sybase IQ option.
See these topics in the Sybase IQ documentation:
Related concepts
User-Defined Functions: Additional Samples