•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 402,690 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,414 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser: Programming Forums
Views: 520 | Replies: 2
![]() |
•
•
Join Date: Apr 2008
Posts: 179
Reputation:
Rep Power: 1
Solved Threads: 0
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
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;![]() |
•
•
•
•
•
•
•
•
DaniWeb Oracle Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Oracle Forum
- Previous Thread: how to get the function last_insert_id()(used widely in mysql) in oracle?
- Next Thread: Create HTML page using PL/SQL



Linear Mode