Auto increment sequence problem
639708May 16 2008 — edited May 16 2008Hi,
Is there any particular thing about 21st record because, when i insert data into same or different table, records start from 21 instead of 1 or where it was finished before.
Example : I leave a table with 3 records. Come back, I insert data into same table then, auto increment starts from 21 not the 4!!!
Thanks
CREATE SEQUENCE FRANC_AUTOINC_SEQ
START WITH 1
INCREMENT BY 1
NOMAXVALUE;
CREATE TRIGGER FRANC_AUTOINC_TRG
BEFORE INSERT ON FRANCHISE
FOR EACH ROW
BEGIN
SELECT FRANC_AUTOINC_SEQ.NEXTVAL INTO :NEW.FRANCHISEID FROM DUAL;
END;