Return a function result.


<return statement> ::= RETURN <return value>
<return value> ::=


The RETURN statement is used to assign the return value of a user-defined function.


The RETURN statement can only appear in the routine body of a function definition.
The return value shall be compatible with the type specified in the RETURNS clause of the function definition.
The cursor specification option shall only be used if the RETURNS clause specify TABLE.


1) The following example returns a character string value:

       RETURN 'Hello World';

2) The following example returns the system date and time:


3) The following example returns a cursor derived from the students table:

       RETURN SELECT * FROM students;


SQL:2003 standard

NexusDB extension



Core SQL

Cursor specification as return value

Home | Site Contents | Documentation | NexusDB Manual V4 | SQL Reference | SQL Statements | Control Statements