Assign a value to an assignment target.
Syntax
SET <assignment target> = <assignment source> |
<assignment target> ::= <target specification>
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" |