Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help w/ Trigger

Help w/ Trigger

From: Victor <penpendisarapen_at_yahoo.com>
Date: 16 May 2002 11:04:18 -0700
Message-ID: <e203374a.0205161004.33f6e799@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US