Re: Pre Delete Triggers

From: <meyer_b_at_rocketmail.com>
Date: Mon, 04 May 1998 20:53:16 -0600
Message-ID: <6ilrec$gs9$1_at_nnrp1.dejanews.com>


Thanks very much Joost. I was looking at that, but couldn't figure out how it applied. I'll try that in the morning.

Bob

In article <354e10de.16472666_at_resunix.sickkids.on.ca>#1/1,   owrkrj_at_mailhub.sickkids.on.ca (Joost Ouwerkerk) wrote:
>
> On Mon, 04 May 1998 12:23:11 -0600, meyer_b_at_rocketmail.com wrote:
>
> >I want to create a pre delete trigger that will copy some of the columns in
> >the row to be deleted into another table. I've got no problem with
inserting
> >into the new table, but how do I reference the values in the current row to
be
> >deleted?
>
> Preface your column names with :old or :new.
>
> For example:
>
> CREATE OR REPLACE TRIGGER trig_audit_emp_hist
> BEFORE DELETE ON employee
> FOR EACH ROW
> BEGIN
> INSERT INTO audit_emp_history (user_name, timestamp, id,
> old_last_name, new_last_name)
> VALUES (user, sysdate, :old.id, :old.last_name, :new.last_name);
>
> END trigin_audit_emp_hist;
>

[Quoted] -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue May 05 1998 - 04:53:16 CEST

Original text of this message