Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 850 Bytes

variables.md

File metadata and controls

41 lines (25 loc) · 850 Bytes

Variables

ZetaSQL supports variables.

Variable types

There are three primary variable types: runtime variables, query parameters, and system variables. Each can be set and unset with the SET and UNSET commands. Additionally, query parameters are prefixed with a single @ symbol and system variables are prefixed with @@.

The variable names must be valid sql identifiers.

SET

Sets a variable.

SET runtime_variable = constant_value;
SET @query_parameter = constant_value;
SET @@system_variable = constant_value;

UNSET

Unsets a variable.

UNSET runtime_variable;
UNSET @query_parameter;
UNSET @@system_variable;