SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
Embedded-Only SQL/MX Statements
HP NonStop SQL/MX Reference Manual—523725-004
3-78
C Examples of Assignment Statement
assignment-source 
specifies a list of value expressions, a list of rowset expressions, the NULL 
specification, or a subquery. These values are to be inserted into the 
assignment-target.
 subquery 
| {expression | rowset-expression | NULL} 
[,{expression | rowset-expression | NULL}]...
is a value expression, rowset expressions, NULL, or the result of a subquery.
NULL can be assigned to a host variable of any type.
If you use a rowset expression or if the subquery returns more than one row, 
the assignment target must consist of rowset host variables.
C Examples of Assignment Statement
•
This SET statement inside the BEGIN and END keywords sets a value that is used 
in the INSERT statement:
... 
EXEC SQL
BEGIN
SET :hv_salesrep = 999; /* sales rep is not known /*
INSERT INTO SALES.ORDERS 
 (ORDERNUM, ORDER_DATE, DELIV_DATE, SALESREP, CUSTNUM) 
 VALUES (:hv_ordernum, :hv_orderdate, :hv_delivdate, 
 :hv_salesrep, :hv_custnum);
END;
...










