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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers on Oracle7 - newbie

Re: Triggers on Oracle7 - newbie

From: Keith <keith.wilby_at_AwayWithYerCrap.com>
Date: 22 Mar 2005 11:23:25 GMT
Message-ID: <Xns9621748696B7Ekeithwilby@10.15.188.42>


"Mark C. Stock" <mcstockX_at_Xenquery .com> wrote:

> first, why version 7? it's way obsolete

I know, but that's what I'm stuck with where I work.

>
> however, this issue is the same across database versions (starting with
> 7)
>
> you need to create a row-level trigger -- check out the FOR EACH ROW
> keywords in the SQL Reference manual
>
> typical example:
>
> create or replace trigger tasks_bir
> before insert on tasks
> for each row
> begin
> select tasks_id.nextval into :new.id from dual;
> end;

I did wonder about "FOR EACH ROW" but wouldn't that update all rows? Remember I'm a clueless newbie!

Thanks for your help.
Keith. Received on Tue Mar 22 2005 - 05:23:25 CST

Original text of this message

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