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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: URGNET PL/SQL Help: PLS-00357

Re: URGNET PL/SQL Help: PLS-00357

From: S Jayakumar <jaykumar_at_mahindrabt.com>
Date: Tue, 17 Oct 2000 16:39:35 +0530
Message-Id: <10652.119435@fatcity.com>


 Hi,

select the sequence's next value into a variable & assign the variable instead of assigning the sequence.nextval

Regards,

Jay

Schoen Volker wrote:

> Hi list,
>
> I want to get a value from a sequence in a trigger. If I try the following
> trigger, I get PLS-00357 error. Any suggestions?
>
> SQL> CREATE OR REPLACE TRIGGER IEINSATZBERICHTE BEFORE INSERT ON
> EINSATZBERICHTE REFERENCING NEW AS
> NEW FOR EACH ROW
> 2 BEGIN
> 3 :NEW.LFDNR := SQ_EINSATZBERICHTE.NEXTVAL;
> 4 END;
> 5 /
>
> Warning: Trigger created with compilation errors.
>
> SQL> show errors;
> Errors for TRIGGER IEINSATZBERICHTE:
>
> LINE/COL ERROR
> -------- -----------------------------------------------------------------
> 2/1 PL/SQL: Statement ignored
> 2/34 PLS-00357: Table,View Or Sequence reference
> 'SQ_EINSATZBERICHTE.NEXTVAL' not allowed in this context
>
> SQL> select SQ_EINSATZBERICHTE.NEXTVAL from SQ_EINSATZBERICHTE;
> select SQ_EINSATZBERICHTE.NEXTVAL from SQ_EINSATZBERICHTE
> *
> ERROR at line 1:
> ORA-02201: sequence not allowed here
>
> TIA
>
> Volker Schön
> E-Mail: mailto:v.schoen_at_inplan.de
> http://www.inplan.de
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Schoen Volker
> INET: v.schoen_at_inplan.de
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Tue Oct 17 2000 - 06:09:35 CDT

Original text of this message

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