Sunday, December 5, 2010

IF IS NOT / <> NULL

IF i_earnings_amount IS NOT NULL THEN
        l_earnings_amount := TO_CHAR(i_earnings_amount, '9999.99');
END IF;

IF i_earnings_amount <> NULL THEN
        l_earnings_amount := TO_CHAR(i_earnings_amount, '9999.99');
END IF;


There is a significant difference between the two statements. IS NOT NULL, tests whether the field/variable has a value. (TODO: further clarify this issue)

No comments:

Post a Comment