Hi,
When i insert data into any table last number of sequnce get increased in all sequences that are listed below. These are for auto incremented numbers. All tables have their own autoincremented coloumns. Can anyone see mistake? 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;
CREATE SEQUENCE EMP_AUTOINC_SEQ
START WITH 1
INCREMENT BY 1
NOMAXVALUE;
CREATE TRIGGER EMP_AUTOINC_TRG
BEFORE INSERT ON EMPLOYEE
FOR EACH ROW
BEGIN
SELECT EMP_AUTOINC_SEQ.NEXTVAL INTO :NEW.EMPLOYEEID FROM DUAL;
END;
CREATE SEQUENCE MNG_AUTOINC_SEQ
START WITH 1
INCREMENT BY 1
NOMAXVALUE;
CREATE TRIGGER MNG_AUTOINC_TRG
BEFORE INSERT ON MANAGER
FOR EACH ROW
BEGIN
SELECT MNG_AUTOINC_SEQ.NEXTVAL INTO :NEW.MANAGERID FROM DUAL;
END;
CREATE SEQUENCE CUST_AUTOINC_SEQ
START WITH 1
INCREMENT BY 1
NOMAXVALUE;
CREATE TRIGGER CUST_AUTOINC_TRG
BEFORE INSERT ON CUSTOMER
FOR EACH ROW
BEGIN
SELECT CUST_AUTOINC_SEQ.NEXTVAL INTO :NEW.CUSTOMERID FROM DUAL;
END;