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: Philippe <parnaud_at_yahoo.com>
Date: Fri, 12 Mar 1999 10:14:25 +0100
Message-ID: <7calu3$7e9$1@concorde.ctp.com>


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

insert into Table2Copy values(:old.colA, ColB, :old.ColD, ...); end;

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

Original text of this message

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