Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> update database trigger
Hi lists,
DB:Oracle 8i
I need to write a db trigger on table T1. It has to update T2 when ever
T1 is updated.
(Both T1 and T2 tables have identical structure.)
The following query is doing wrong update.
can anybody tell me what is wrong in this code:
create or replace trigger trg_on_T1
before update on T1
for each row
begin
if updating then
update T2
set a=:new.a, b=:new.b, c=:new.c; -- how to add the where clause..?end if;
I dont know how to use where clause in this. b'coz all columns can be updated by users.
Can anybody give any hints.
Thnx in advance
Srinivas
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tatireddy, Shrinivas (MED, Keane) INET: Shrinivas.Tatireddy_at_med.ge.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Wed Dec 12 2001 - 02:16:26 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |