declare
a number:=null;
b number:=null;
begin
if a=b
then dbms_output.put_line('SIM');
else dbms_output.put_line('não');
end if;
end;
SQL> /
não
Para "sanar" este problema, é possivel usar NVL, que não é uma boa prática. Veremos porque:
if nvl(a, 123456789) = nvl(b, 123456789)
then --seu código
MUITO EFICIENTE
A melhor prática possível
É um pouco trabalhosa, mas sempre funcionará:
if a<>b
or (a is null and b is not null)
or (a is not null and b is null)
then --seu codigo