DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
PL/SQL Comparaison Between 2 Varchar When One Is NULL
This is a PL/SQL piece of code on Oracle 9i.
The <> operator does not work as desired with strings.
declare
text1 varchar2(100);
text2 varchar2(100);
begin
text1 := 'toto';
text2 := NULL;
if text1 <> text2 then
dbms_output.put_line('true');
else
dbms_output.put_line('false');
end if;
end;
Result:
false





