Return a function result.

 

Syntax

 

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

 

<return value> ::=

 

 

Usage

 

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

 

 

Notes

 

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.



 

 

Examples

 

1)

The following example returns a character string value:



 


RETURN 'Hello World';



 

2)

The following example returns the system date and time:



 


RETURN CURRENT_TIMESTAMP;



 

3)

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



 


RETURN SELECT * FROM students;



 

 


 

Conformance

 

SQL:2003 standard

 

NexusDB extension

-

 

-

Core SQL

 

Cursor specification as return value