Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

RETURN - Supply the return value of a User Defined Function (UDF)

RETURN supplies the return value of a UDF. The data type of the return value is defined by the RETURNS clause of the CREATE FUNCTION statement.

The RETURN statement may only be specified in the definition of a UDF with CREATE FUNCTION. UDFs and their use in SESAM/SQL are described in detail in chapter "Routines".

A RETURN statement terminates the execution of a UDF directly.
If a UDF is not terminated with a RETURN statement, this results in an error in the calling SQL statement.



RETURN { expression | NULL }



expression

Expression whose value is assigned to the return value of the UDF.
The expression may contain routine parameters and (if the statement is part of a COMPOUND statement) local variables, but no host variables.
A column may be specified only if it is part of a subquery.
The data type of expression must be compatible with the data type of the RETURNS clause from the CREATE FUNCTION statement.
The rules in section "Entering values in a procedure parameter (output) or local variable" apply.


NULL

The return value of the UDF is the NULL value.

See also

CREATE FUNCTION