Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Sequence NextVal jumping 18 on reboot!
Using NT4 Server, Personal Oracle 7.3.4
Please someone tell me I'm not going stupid but every time I reboot my PC the NEXTVAL in a very simply sequence (see below) increases by 18!
For example if the last CRAFT_ID used was 3 on reboot the new one's 21
Here is the code - generated by Oracle Migration Wizard for MS Access!
////////////////////////////////////////////////////////////////////////////////////////////
CREATE SEQUENCE SEQ_NLS_CRAFTS
INCREMENT BY 1 START WITH 1
/
CREATE TRIGGER TRG_NLS_CRAFTS
BEFORE INSERT OR UPDATE ON NLS_CRAFTS
FOR EACH ROW
DECLARE
iCounter NLS_CRAFTS.CRAFT_ID%TYPE;
cannot_change_counter EXCEPTION;
BEGIN
IF INSERTING THEN
Select SEQ_NLS_CRAFTS.NEXTVAL INTO iCounter FROM Dual; :new.CRAFT_ID := iCounter;
IF NOT (:new.CRAFT_ID = :old.CRAFT_ID) THEN RAISE cannot_change_counter; END IF;
WHEN cannot_change_counter THEN raise_application_error(-20000, 'Cannot Change Counter Value');END;
I can't for the life of me work out what the hell's going on!
Any ideas
Thanks
Adrian Harrison Received on Fri Jan 15 1999 - 04:53:29 CST