Use the Return Data Type page of the New User-Defined Function
wizard to specify the data type that you want the function to return.
- Return columns
- For table user-defined functions only: Shows the data types that will
be returned based on the SQL statement.
- Data type
- For scalar user-defined functions only: Specify the data type of the user-defined
function return value.
- Length
- For scalar user-defined functions only: Type a length for the selected
SQL data type. This option is available only for the following SQL data types:
BLOB, CHAR, CLOB, DBCLOB, GRAPHIC, VARCHAR, VARGRAPHIC, and LONG VARCHAR.
- Unit
- For scalar user-defined functions only: Select a unit of size for the
selected SQL data type. This option is available only for the following SQL
data types: BLOB, CLOB, and DBCLOB.
- Precision
- For scalar user-defined functions only: Type a number between 1 and 31
for the total number of digits that the value can contain. This option is
available only for the following SQL data types: DECIMAL, FLOAT, and NUMERIC.
The precision of binary integers and decimal numbers is the total number of
binary or decimal digits, excluding the sign. The precision of floating-point
numbers is either single or double, which refers to the number of digits in
the fraction. The precision cannot be negative.
- Scale
- For scalar user-defined functions only: Type a number for the number of
digits to the right of the decimal point. This option is available only for
the following SQL data types: DECIMAL, FLOAT, and NUMERIC. The scale cannot
be negative or greater than the precision. The maximum precision is 31 digits.
If you specify a scale, you must also specify a precision. By default, the
scale is 0.
- For bit data
- For scalar user-defined functions only: Select to specify the bit data
subtype for all character strings. This option is available only for the SQL
types CHAR and VARCHAR. The bytes of a character string with the bit data
subtype do not represent characters. When you select this option, no character
conversion is performed on character strings. Tip: Select this option
when you are passing large binary strings, such as encrypted passwords, to
a user-defined function.