描述

该语句用来设置用户自定义和系统定义的 session 变量。

格式

  1. SET var1_name = var1_value, var2_name = var2_value, ...;

参数解释

参数

描述

var1_name

指定要设置的变量,可以是用户自定义的变量,也可以是系统变量。如果要设置多个变量,中间用 , 分隔。

示例

  1. OceanBase(TEST@TEST)>set @a = 1, @b = 2, @c = 3;
  2. Query OK, 0 rows affected (0.02 sec)
  3. OceanBase(TEST@TEST)>set @@tx_isolation = 'read-what';
  4. ORA-00600: internal error code, arguments: -5145, Variable 'tx_isolation' can't be set to the value of 'read-what'
  5. OceanBase(TEST@TEST)>set @@tx_isolation = 'read-committed';
  6. Query OK, 0 rows affected (0.01 sec)
  7. OceanBase(TEST@TEST)>select @a,@b,@c,@@tx_isolation from dual;
  8. +------+------+------+----------------+
  9. | @A | @B | @C | @@TX_ISOLATION |
  10. +------+------+------+----------------+
  11. | 1 | 2 | 3 | read-committed |
  12. +------+------+------+----------------+
  13. 1 row in set (0.01 sec)