Hi all,
i'm asking how to manage nulls value in a pl sql procedure in a better way;
I have this fragment of a store procedure pl/sql
w_circ_1 := TH_PKG.GET_CIRC_TCD(P_Param);
w_circ_2 := TH_PKG.GET_CIRC_TW(P_Param);
IF val in (w_circ_1,w_circ_2 ) then
--do something
else
--do otherthing
end if;
and
w_circ_1 := nvl(TH_PKG.GET_CIRC_TCD(P_Param), '*');
w_circ_2 := nvl(TH_PKG.GET_CIRC_TW(P_Param), '*');
IF val in (w_circ_1,w_circ_2 ) then
--do something
else
--do otherthing
end if;
So in the second block the nulls value are substituted with an *, and in this way the IF statment make a comparision using the in operator with (*,*).
while in the first case the compare as it was (null,null);
I 've seen that both case works correctely, but I'm asking if there is one that is better from the other and way.
thanks really much