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 -> Re: Help with Trigger!!!

Re: Help with Trigger!!!

From: Database Generation Ltd. <datagen_at_dircon.co.uk>
Date: Wed, 10 Mar 1999 19:05:25 +0000
Message-ID: <36E6C275.4E0C@dircon.co.uk>


Dear Friends,

Thank you very much - this working very good. Can you help with a little bit more complicated one? I have Table1(ColA, ColB, ColC,....)
trigger before delete making a copy of Record into the Table1Copy(ColA, ColB, ColC,...)
All OK.
Next I have Table2(ColA, ColD,...) that linked with the Table1 via the ColA;
I want to create the trigger that will copy Record before delete into the Table2Copy(ColA, ColB,ColD,...) that have the same fields as a Table2 but one field more(ColB) that must be taken from Table1. I try to do this:
create trigger x before delte on Table2 for each row declare

      ColB Number(6,0);
begin

      select ColB into ColB from Table1
      where Table2.ColA = Table1.ColA

insert into Table2Copy values(:old.colA, ColB, :old.ColD, ...); end;
Unfortunately this is not working...
Can you help?
Thank you very much again...
Eugene Received on Wed Mar 10 1999 - 13:05:25 CST

Original text of this message

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