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

Home -> Community -> Usenet -> c.d.o.server -> Re: Restricting FOR EACH ROW to newly inserted row

Re: Restricting FOR EACH ROW to newly inserted row

From: Eoin Gardiner <eoin7_at_my-deja.com>
Date: Fri, 17 Nov 2000 05:58:18 GMT
Message-ID: <8v2hdp$qgn$1@nnrp1.deja.com>

In article <3A14B636.B34747BD_at_page.ca>,
  chris carleton <chrisc_at_page.ca> wrote:
> Hi,
> If I have a trigger on a table that fires on INSERT is it possible to
> restrict the trigger to only the newly inserted row? I want to add an
> entry into a child (essentially a copy of the parent) table whenever a
> new item gets inserted into the parent -- but I don't want the trigger
> to fire on all existing rows in the parent table. Is there a more or
> less standard way of maintaing two copies of one table in this manner?
> Any help is greatly appreciated. Thanks.
>
> Scott
>

Scott,

I think you don't have a problem. The FOR EACH ROW designation of a trigger means for each row being changed, not for each row in the table.

I assume you are creating the trigger like this:

CREATE OR REPLACE TRIGGER AI_MYTRIGGER AFTER INSERT ON MY_TABLE FOR EACH ROW.... This will only fire for a newly inserted row.

HTH Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Nov 16 2000 - 23:58:18 CST

Original text of this message

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