Assignment Statement
You are looking at an older version of the documentation. The latest version is found here.
An assignment statement assigns a value to a variable by evaluating an expression. Before a value can be assigned to a variable, the variable needs to have been declared (see Declaration Statement).
Usage
<variable reference> = <expression>;
Syntax
BEGIN
-- declarations
DECLARE STRING myString;
DECLARE INTEGER x;
-- assignments
myString = 'Thank you';
VARIABLES.x = (SELECT 1);
END
Valid variables for assignment include any in-scope variable that has been declared with a declaration statement, or the procedure's IN/OUT
and OUT
parameters. IN/OUT
and OUT
parameters can be accessed as their fully qualified names.
Example with an Out Parameter
CREATE VIRTUAL PROCEDURE proc (OUT x STRING, INOUT y STRING) AS
BEGIN
proc.x = 'some value ' || proc.y;
y = 'some new value';
END