Assign a value to an assignment target.


Syntax

<assignment statement> ::=

<assignment target> ::= <target specification>
<assignment source> ::=


Usage

The SET statement is used to assign values to assignment targets such as SQL variables, SQL parameters and columns of a transition table.


Notes

The data types of the assignment target and the assignment source shall be compatible.


Examples

1) The following example assigns a value to the name SQL variable:

       SET name = firstName || ' ' || lastName;

2) The following example assigns a value to a column of the transition table pointed to by the NEW variable in the context of a trigger definition:

       SET NEW.lastUpdated = CURRENT_TIMESTAMP;


Conformance

SQL:2003 standard

-

SQL/PSM Feature P002-05 "Assignment statement"

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