oracle中:
create table testnull(id number(10,0),c1 varchar2(10),c2 varchar2(20));
insert into testnull(id,c1) values(1,null);
insert into testnull(id,c1) values(2,'');
commit;
SQL> select count(*) from testnull where c1 is null;
COUNT(*)
----------
2
SQL> select count(*) from testnull where c1='';
COUNT(*)
----------
0
SQL> select count(*) from testnull where c2 is null;
COUNT(*)
----------
2
SQL> select count(*) from testnull where c2='';
COUNT(*)
----------
0
------------------------------------------
采用KDTS迁移到金仓kingbase数据库中后:
ksql test system
test=# show ora_input_emptystr_isnull;
ora_input_emptystr_isnull
---------------------------
on
(1 行记录)
test=# select count(*) from testk.testnull where c1 is null;
count
-------
2
(1 行记录)
test=# select count(*) from testk.testnull where c1='';
count
-------
0
(1 行记录)
test=# select count(*) from testk.testnull where c2 is null;
count
-------
2
(1 行记录)
test=# select count(*) from testk.testnull where c2='';
count
-------
0
(1 行记录)
结论:ora_input_emptystr_isnull为on时,二者结果相同。