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

Home -> Community -> Usenet -> c.d.o.server -> Re: trigger to update insert into History table - cannot get to work

Re: trigger to update insert into History table - cannot get to work

From: Guido Konsolke <Guido.Konsolke_at_triaton.com>
Date: Thu, 27 Feb 2003 09:10:08 +0100
Message-ID: <1046333389.910039@news.thyssen.com>


"Richard Brust" <richard_brust_at_yahoo.com> schrieb im Newsbeitrag news:8b15ae11.0302261729.3dd3431f_at_posting.google.com...
> I have two tables "related" by an ID field. [t1 has 6 fields, t2 has
> two.] First field of both is the ID.
>
> When I update t1, I want all the values from t1 (except the ID) and
> the second field (not ID) from t2 to be inserted in to a History
> table.

(snipped)

Hi Richard,
Maybe (I can't test it) something like this will work: 1.) Select StatusName into SomeVar from status where id = :old.id; 2.) insert into PartsHistory values

     (SomeVar,
      :old.PartNo,
      :old.StatusID,
      :old.Memo,
      :old.LastUpdateOn,
      :old.UpdateBy
     );

Corrections and / or additions always welcome.

hth,
Guido Received on Thu Feb 27 2003 - 02:10:08 CST

Original text of this message

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