Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Help w/ Trigger
Hello,
I'm a novice at this, so bear with me. I recently took a basic PL/SQL class, but I did not get a whole lot of examples or instructions for this.
I need to track the date that a record was last modified, so I created a mod_date column in the table. I was hoping to have a trigger modify it each time an update is made for the row. I created the following trigger which doesn't seem to work:
CREATE OR REPLACE TRIGGER set_bom_disp_mod_date
BEFORE UPDATE ON bom_disposition
FOR EACH ROW
WHEN(NEW.mod_date IS NULL)
BEGIN
SELECT SYSDATE
INTO :NEW.mod_date
FROM dual;
END;
/
Could someone tell me what I'm doing wrong? TIA!
Thanks!
Victor Received on Thu May 16 2002 - 13:04:18 CDT