Handling NULL in SQL
InterSystems FAQ rubric
In SQL, NULL data and the empty string ('') are different data. The method for setting and checking each is as follows.
(1) NULL data
[SQL]
insert into test(a) values(NULL)
select * from test where a IS NULL[InterSystems ObjectScript]
set x=##class(User.test).%New()
set x.a=""(2) Empty string ('')
[SQL]
insert into test(a) values('')
select * from test where a = ''[InterSystems ObjectScript]
set x=##class(User.test).%New()
set x.a=$C(0)For more information, please refer to the following documents:
Go to the original post written by @Tomoko Furuzono
Discussion (0)1