Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!news-xfer.cox.net!p01!news2.east.cox.net.POSTED!53ab2750!not-for-mail
From: "Brian E Dick" <bdick@cox.net>
Newsgroups: comp.databases.oracle.misc
References: <slrn3vsavhivd.9th3.nie@pobox.upenn.edu> <3DF8E013.7FA3F995@exesolutions.com> <slrn3vsavhuts.7a6l.nie@pobox.upenn.edu>
Subject: Re: Mutating problem when delete
Lines: 61
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <JFaK9.8931$0b.274178@news2.east.cox.net>
Date: Fri, 13 Dec 2002 01:24:57 GMT
NNTP-Posting-Host: 68.1.188.187
X-Complaints-To: abuse@cox.net
X-Trace: news2.east.cox.net 1039742697 68.1.188.187 (Thu, 12 Dec 2002 20:24:57 EST)
NNTP-Posting-Date: Thu, 12 Dec 2002 20:24:57 EST
Organization: Cox Communications
Xref: newsfeed1.easynews.com comp.databases.oracle.misc:90514
X-Received-Date: Thu, 12 Dec 2002 18:26:28 MST (news.easynews.com)

Are you extracting denormalized data from a mainframe and loading it into a
normalized Oracle database?

"Zhiping Nie" <nie@mail.med.upenn.edu> wrote in message
news:slrn3vsavhuts.7a6l.nie@pobox.upenn.edu...
> Good question!
> I just gave the example to simulate my case.
> In fact, the t1 is holding
> the data from mainframe and then the data will
> be splitted into several normalized tables. Well, it is the design issue,
> I am a developer and have to do my work.
>
> Any idea about my problem?
> Thanks,
> ZP
> >
> >> 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
> >
> >Why? Why not just insert the row directly into t2? All it appears to me
> >you are doing is making a simple task difficult, unscalable, and error
> >prone as you have discovered.
> >
> >It is not that it can't be done. But why bother?
> >
> >Dan Morgan
> >


