Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers on Oracle7 - newbie
"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