The SET statement assigns a value to a parameter or a local variable of a routine. It may may only be specified in a routine, i.e. in the context of a CREATE PROCEDURE or CREATE FUNCTION statement. Routines and their use in SESAM/SQL are described in detail in chapter "Routines".
SET {
routine_parameter |
local_variable } = {
expression | NULL }
routine_parameter
Procedure parameter of the type INOUT or OUT of the current procedure, see "CREATE PROCEDURE - Create procedure".
local_variable
Local variable of the current COMPOUND statement, see "COMPOUND - Execute SQL statements in a common context".
expression
Expression whose value is assigned to the procedure parameter or local variable. The expression may contain routine parameters and (if the statement is part of a COMPOUND statement) local variables, but no host variables.
A column may be specified only if it is part of a subquery.
The data type of the expression must be compatible with the data type of the procedure parameter or of the local variable. The rules in section "Entering values in a procedure parameter (output) or local variable" apply.
NULL
The procedure parameter or the local variable is assigned the NULL value.
Example
SET number_of_reads = (SELECT COUNT (*) FROM mytable)
See also
COMPOUND, CREATE FUNCTION, CREATE PROCEDURE