Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Check on column when record is updated
What I need is to make sure my application vendor always updates the "Mod_De_Emp_Id" (Modified
Date-Entry Employee ID) column for the record that is being modified.
It is nullable on inserts (I have another field "De_Emp_Id" that is not null).
Is there a way in the trigger that I can check whether an input for "Mod_De_Emp_Id" has been made? What I need is to make sure my application vendor always updates the "Mod_De_Emp_Id" (Modified Date-Entry Employee ID) column for the record that is being modified. It is nullable on inserts.
Maybe something like:
IF :input.Mod_De_Emp_Id is null
THEN RAISE_APPLICATION_ERROR(-20110, 'Need an updated Mod_Emp_Id for Modifications.');
END IF;
I have searched the net but did not come up with much.
Made something up.
This is half-working:
BEGIN
IF :new.Mod_De_Emp_Id is null THEN RAISE_APPLICATION_ERROR(-20110, 'Need an updated Mod_Emp_Id.'); END IF; IF :NEW.Mod_De_Emp_Id = :OLD.Mod_De_Emp_Id THEN RAISE_APPLICATION_ERROR(-20110, 'Need an updated Mod_Emp_Id for Modifications.'); END IF;
Any pointers?
To e-mail me, remove "rm_" Received on Wed Jan 22 2003 - 01:23:44 CST