Can anyone help me understand when to use :NEW and :OLD in PLSQL blocks, I’m finding it very difficult to understand their usage.
Can anyone help me understand when to use :NEW and :OLD in PLSQL blocks,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You normally use the terms in a trigger using
:oldto reference the old value and:newto reference the new value.Here is an example from the Oracle documentation linked to above
In this example the trigger fires
BEFORE DELETE OR INSERT OR UPDATE:old.salwill contain the salary prior to the trigger firing and:new.salwill contain the new value.