Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Restricting FOR EACH ROW to newly inserted row
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