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
SQLSQL
[InterSystems ObjectScript]
set x=##class(User.test).%New()
set x.a=""
ObjectScriptObjectScript
(2) Empty string ('')
[SQL]
insert into test(a) values('')
select * from test where a = ''
SQLSQL
[InterSystems ObjectScript]
set x=##class(User.test).%New()
set x.a=$C(0)
ObjectScriptObjectScript
For more information, please refer to the following documents: