Files
oceanbase/docs/docs-cn/13.reference-guide/2.system-variable/35.sql_auto_is_null.md
2022-02-10 14:51:49 +08:00

1.3 KiB

sql_auto_is_null

sql_auto_is_null 会被一些特殊的驱动程序,例如 ODBC 使用,用于获取最后插入行的自增列值。

属性 描述
参数类型 bool
默认值 OFF
取值范围 * OFF * ON
生效范围 * GLOBAL * SESSION
是否参与序列化
是否影响计划生成

当 sql_auto_is_null 为 ON 时,与下面两条语句等价:

// CREATE TABLE t1 (auto_inc_column auto_increment, j int);
obclient> SELECT * FROM t1 WHERE auto_inc_column is null;

obclient> SELECT * FROM t1 WHERE auto_inc_column = last_insert_id();