Pour SQL, null et la chaîne vide ('') sont distinguées. Chaque méthode de définition/réception est la suivante.
(1) NULL
【SQL】
insert into test (a) values (NULL)
select * from test where a IS NULL
select * from test where a IS NULL
【InterSystems ObjectScript】
set x=##class(User.test).%New()
set x.a=""
set x.a=""
(2) Chaîne vide ('')
【SQL】
insert into test (a) values ('')
select * from test where a = ''
select * from test where a = ''
【InterSystems ObjectScript】
set x=##class(User.test).%New()
set x.a=$C(0)
set x.a=$C(0)
Pour plus de détails, veuillez consulter les documents suivants.
NULL and the Empty String (IRIS)
NULL and the Empty String (Caché)