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: Trigger syntax

Re: Trigger syntax

From: Aman & Manisha <handa_at_worldnet.att.net>
Date: 1997/01/30
Message-ID: <32F13090.543B@worldnet.att.net>#1/1

David Vodnansky wrote:
>
> Hi all,
>
> I have problems with trigger syntax in Oracle (I usually use Interbase).
> Simple example :
>
> create table adresy (id number(3,0),text varchar2(25));
> create sequence gen_adresaid ......;
>
> CREATE TRIGGER gen_adr_id
> BEFORE INSERT ON ADRESY
> FOR EACH ROW
> BEGIN
> new.id:=gen_adresaid.nextval; <--- this line is wrong, why ?
> end;
>
> Thanks for advice.
>
> -------------------
> David Vodnansky
> ICL Czech republic
> vodnansky_at_icl.cz
> -------------------You need to assign the sequence value to id via a SELECT stmt.
eg: SELECT gen_adresaid.nextval

    INTO id
    FROM dual; Received on Thu Jan 30 1997 - 00:00:00 CST

Original text of this message

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