Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

NVL logic in trigger

Badam123Aug 2 2017 — edited Aug 3 2017

ELSIF UPDATING THEN

    IF NVL(:OLD.IS_ACTIVE,'X')               = NVL(:NEW.IS_ACTIVE,'X')                       -- varchar2(1)

      AND NVL(:OLD.NOTES,'XXXXX')     = NVL(:NEW.NOTES,'XXXXX')          -- varchar2(50)

      AND NVL(:OLD.EID,'XXXXX')           = NVL(:NEW.EID ,'XXXXX')  THEN      -- varchar2(20)

      RETURN;

In a trigger I have written the above logic to check for the old and new values , If the three columns are equal then I want the trigger to return without doing anything .

From the above logic, there can be some cases where the Old value can be null and the new value can be 'XXXXX'  the condition will be TRUE and trigger will return without doing anything , which is FALSE .

Please suggest how to handle this kind of logic , So that the conditions are always/mostly correct.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2017
Added on Aug 2 2017
8 comments
1,721 views