Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> URGENT! AUTOINCREMENT PROBLEMS
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 - 09:03:27 CDT
![]() |
![]() |