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

Home -> Community -> Mailing Lists -> Oracle-L -> update database trigger

update database trigger

From: Tatireddy, Shrinivas (MED, Keane) <Shrinivas.Tatireddy_at_med.ge.com>
Date: Wed, 12 Dec 2001 00:16:26 -0800
Message-ID: <F001.003DA912.20011212000518@fatcity.com>

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;
end trg_on_T1;

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-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Wed Dec 12 2001 - 02:16:26 CST

Original text of this message

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