Skip to main content
Skip table of contents

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

SQL
<variable reference> = <expression>;

Syntax

SQL
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

SQL
CREATE VIRTUAL PROCEDURE proc (OUT x STRING, INOUT y STRING) AS
BEGIN
  proc.x = 'some value ' || proc.y;
  y = 'some new value';
END
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.