Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issue with sequence

user545194Apr 16 2008 — edited Apr 17 2008
Hi!

I created a sequence:

CREATE SEQUENCE "XXX"."FLIGHT_LEG_SEQ"
MINVALUE 0 MAXVALUE 100000 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER CYCLE ;

Sequence after inserting a row into table:

CREATE SEQUENCE "XXX"."FLIGHT_LEG_SEQ"
MINVALUE 0 MAXVALUE 100000 INCREMENT BY 1 START WITH 24 CACHE 20 NOORDER CYCLE ;

Here is the trigger that uses this sequence:

create or replace TRIGGER NEW_LEG_ID
BEFORE INSERT ON FLIGHT_LEGS
FOR EACH ROW
BEGIN
SELECT flight_leg_seq.NEXTVAL INTO :new.leg_id
FROM dual;
END;

The sequence is set to increment by 1, however the next value is 24? What could be the reason for this?

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2008
Added on Apr 16 2008
26 comments
936 views