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 -> Sequence/Trigger problem

Sequence/Trigger problem

From: Volker Schmid <Info_NoSpam_at_Inspirant.de>
Date: Wed, 30 Oct 2002 15:24:10 +0100
Message-ID: <apopva$3sc$1@news.online.de>


Hello,

I have a strange problem with my sequence in combination with a trigger. The case is simple and well known: I need a auto-increment ID!

I use this to create the auto-increment:

CREATE SEQUENCE USERS_SEQ START WITH 1 INCREMENT BY 1; CREATE OR REPLACE TRIGGER "TR_USERS"
BEFORE INSERT ON "USERS"
FOR EACH ROW
BEGIN
SELECT USERS_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; END; For other tables I do exactly the same with other sequence/trigger-names.

It works but there is something I don't understand:

Why is the sequence hopping sometimes from the value 1 to 21 or from 24 to 48? I really want some values without those jumps. What is wrong or do I missunderstood something about sequences? Is it possible that other sequences interact with my needed sequence? Or is the problem that I use UPDATE Users WHERE... on this?

Any ideas, tips or secrets?

Thank you

Volker Received on Wed Oct 30 2002 - 08:24:10 CST

Original text of this message

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