Purpose
This statement is used to set user-defined variables (@) and session-defined variables ( @@).
Syntax
SET variable_name = variable_value[,variable_name = variable_value...]
Parameters
| Parameter | Description |
|---|---|
| variable_name | Specifies the variable to set, which can be a user-defined variable or a system variable. If multiple variables are to be set, separate them with commas (,). |
| variable_value | Specifies the value to set for the variable. |
Examples
obclient> SET @a = 1, @b = 2, @c = 3;
obclient> SET @@tx_isolation = 'read-committed';
obclient> SELECT @a,@b,@c,@@tx_isolation FROM DUAL;
