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: URGENT! AUTOINCREMENT PROBLEMS

Re: URGENT! AUTOINCREMENT PROBLEMS

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Sat, 4 Sep 1999 06:24:52 +0200
Message-ID: <936419138.16940.0.pluto.d4ee154e@news.demon.nl>


Replace AO_MASKIN in the trigger by DUAL. Your select should retrieve 1 row, always. DUAL contains 1 row.

Hth,

--
Sybrand Bakker, Oracle DBA
Jerra <jerra_at_consilia.aland.fi> wrote in message news:7qokeh$qtt$1_at_gandalf.alcom.aland.fi...
> Two fields make up the primary key. One is supplied by the application
> running against the database the other is supposed to be autoincrement.
>
> The Sequence:
> Create Sequence seq_AO_Maskin Increment by 1;
>
> Trigger Code:
>
> CREATE OR REPLACE TRIGGER trg_Ins_AO_Maskin BEFORE INSERT ON AO_Maskin
> Referencing NEW AS Inserted
> For Each Row
> Begin
>
> SELECT (seq_AO_Maskin.NEXTVAL) INTO :Inserted.Count_Id
> FROM AO_MASKIN;
>
> End;
>
>
> XXXXXXXX
>
> INSERT INTO AO_MASKIN (AO_ID) VALUES (21);
>
> Gives these error messages:
>
> SQLWKS> INSERT INTO AO_MASKIN (AO_ID) VALUES (21);
> ORA-01403: no data found <<<<< ?????
> ORA-06512: at "x.TRG_INS_AO_MASKIN", line 3
> ORA-04088: error during execution of trigger 'x.TRG_INS_AO_MASKIN'
>
>
> What is wrong with the trigger?
>
> Any advice greatly appreciated!
> Thanks!
>
> J Dahlblom
>
>
>
>
Received on Fri Sep 03 1999 - 23:24:52 CDT

Original text of this message

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