The SET host-variable statement enables directly assigning the results of an SQL value expression to a host variable. This statement can only be used in embedded SQL.
►►── SET ──── host-variable ───────── = ────┬─ value-expression ─┬────────────►◄ └─ NULL ─────────────┘
Identifies a host-variable that is to receive the value of the specified value expression or null. Host-variable must be a host variable previously declared in the application program.
Specifies the value to be assigned to the destination or receiving field of the assignment statement.
Specifies that host-variable is set to the NULL value.
The rules for assignment are provided in Comparison, Assignment, Arithmetic, and Concatenation Operations.
The host-variable COMB-NAME is constructed from the values in the host-variables FIRST-NAME and LAST-NAME.
EXEC SQL set:COMB-NAME=trim(:FIRST-NAME) ||' '|| trim(:LAST-NAME); END-EXEC
|
Copyright © 2014 CA.
All rights reserved.
|
|