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 -> [Fwd: Compilation errors in TRIGGER]

[Fwd: Compilation errors in TRIGGER]

From: Titus Leskien <tle_at_noell.de>
Date: Thu, 29 Jul 1999 15:43:11 +0200
Message-ID: <37A05A6F.A41246E3@noell.de>

 


attached mail follows:



Hi,

you cannot assign a value from a sequence to a variable. instead of that, use

select seql.nextval into :new.id from dual;

for assignment use generally := instead of =.

Bye

Titus Leskien

kev schrieb:
>
> Hi,
>
> I'm trying to create a trigger for autonumbering. I get this error
> message though:
>
> MGR-00072: Warning: TRIGGER TRIG1 created with compilation errors.
>
> Can I find out what these compilation errors are?
>
> Or even better, can you tell me what's wrong with this code (I'm using
> svrmgrl) ? :-)
>
> create trigger trig1 before insert on webtab1
> for each row
> BEGIN
> :new.id = seq1.nextval;
> END;
> /
>
> seq1 is a sequence. The table webtab1 just has 3 columns: id number(4),
> lname varchar2(10), fname varchar2(10)
>
> Thanks in advance,
>
> - Kev



Received on Thu Jul 29 1999 - 08:43:11 CDT

Original text of this message

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