0
点赞
收藏
分享

微信扫一扫

kingbase参数ora_input_emptystr_isnull

KingbaseES 为了兼容Oracle,增加了参数ora_input_emptystr_isnull,用于控制 '' 和 null 的比较。参数说明:

#set the input_emptystr_isnull's default values, valid values are true(on) or false(off)

#true(on):oracle style. the empty string as NULL

#when the input string is empty and and can be set to a NULL

#ora_input_emptystr_isnull = true       # default true

输入空字符串时的处理措施。 on 表示将输入的空字符串作为null 值处理。 off 表示不处理。

例子:

test=# create table test01 (id int,name varchar(30));

CREATE TABLE

kingbase参数ora_input_emptystr_isnull_类型约束

kingbase参数ora_input_emptystr_isnull_类型约束_02

kingbase参数ora_input_emptystr_isnull_类型约束_03

总结:

当ora_input_emptystr_isnull=off时,''属于字符串类型,无法转换成其他数据类型。

当ora_input_emptystr_isnull=on时,''被转成null,而null没有类型约束,所以可以转换为任意类型。

所以在使用时,尽量不修改ora_input_emptystr_isnull参数,可能会影响后续的select访问结果。

举报

相关推荐

0 条评论