Subset of SQL Data Types

The built-in SQL data types that a user-defined function (UDF) can return are language-dependent.

For more information, see the table that follows. See also Data Type.

UDFs written in a given language can return values of any built-in data type except the types that are marked with an X in the following table.
Data Type C Java™ SPL
BIGSERIAL X X X
BLOB X
CLOB X
BYTE X X
TEXT X X
BSON ? X ?
JSON ? X ?
COLLECTION X
LIST X
MULTISET X
ROW X
SET X
SERIAL X X X
SERIAL8 X X X

In HCL OneDB™, if you use a complex data type in the Return clause, the calling user-defined routine must define variables of the appropriate complex types to hold the values that the C or SPL user-defined function returns.

User-defined functions can return a value of opaque or distinct data types that are defined in the database.

The default precision of a DECIMAL value that an SPL function returns is 16 digits. For a function to return a DECIMAL with a different number of significant digits, you must specify the returned precision explicitly in the data type specification of the Return clause.