Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!news.infoave.net!arclight.uoregon.edu!logbridge.uoregon.edu!nntp.upenn.edu!nie
From: nie@mail.med.upenn.edu (Zhiping Nie)
Newsgroups: comp.databases.oracle.misc
Subject: Mutating problem when delete
Date: Thu, 12 Dec 2002 17:48:29 +0000 (UTC)
Organization: University of Pennsylvania
Lines: 34
Message-ID: <slrn3vsavhivd.9th3.nie@pobox.upenn.edu>
NNTP-Posting-Host: pobox.upenn.edu
X-Trace: netnews.upenn.edu 1039715309 523162 128.91.2.38 (12 Dec 2002 17:48:29 GMT)
X-Complaints-To: abuse@nntp.upenn.edu
NNTP-Posting-Date: Thu, 12 Dec 2002 17:48:29 +0000 (UTC)
User-Agent: slrn/0.9.5.7 (UNIX)
Xref: newsfeed1.easynews.com comp.databases.oracle.misc:90481
X-Received-Date: Thu, 12 Dec 2002 10:57:47 MST (news.easynews.com)

My environment:Win2k & Oracle 9i2.

There are two tables T1, T2 which have similar structure.
  T1                 T2
-------		-------------
   c1		     c1
   c2		     c2
   c3

What I want to do is: 
whenever T1 gets a row in,
T2 will get same row, and then the row in T1 will be deleted.

Here is the example code: 
create trigger t1_trigger
before insert on t1
on each row
referencing new as new old as old
begin
insert into t2 values(:new.c1, :new.c2);
end;

create trigger t2_trigger
after insert on t2
on each row
referencing new as new old as old
begin
delete from t1 where c1=:new.c1;
end;

Is it possible to get it done?
Thanks in advance!

ZP
