Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: trigger to update insert into History table - cannot get to work
"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