Navigation:  NexusDB Guide > SQL Reference > SQL Statements > Control Statements >

RETURN statement

Previous pageReturn to chapter overviewNext page

NexusDB V3 Manual

RETURN statement

button_main button_prev button_next

NexusDB Manual V3 > SQL Reference > SQL Statements > Control Statements

Return a function result.

 

Syntax

 

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

 

<return value> ::=

 

 

|

|

 

<value expression>

NULL

<cursor specification>

 

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

 

© Nexus Database Systems Pty Ltd.

nexus_logo