Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with Trigger!!!
create trigger x before delte on Table2 for each row
declare
ColB Number(6,0);
begin
select ColB into ColB from Table1 where Table1.ColA = :old.ColA
HTH, Philippe
Database Generation Ltd. wrote in message <36E6C275.4E0C_at_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 Fri Mar 12 1999 - 03:14:25 CST
![]() |
![]() |