Skip to Main Content

Oracle Database Discussions

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!

Sequence then trigger creation problem

453304Sep 29 2005 — edited Sep 30 2005
Hi guys,

I'm trying to create a sequence/trigger combination for auto incrementing a table. The trouble is, when I run the script in SQL*Plus Works, it creates the sequence, but ignores the trigger and I can't figure out why.

CREATE SEQUENCE seq_SupportItems START WITH 1 INCREMENT BY 1 NOMAXVALUE;

CREATE TRIGGER trig_SupportItems
BEFORE INSERT ON t_SupportItems
FOR EACH ROW
BEGIN
SELECT seq_SupportItems.nextval INTO :new.si_ID FROM DUAL;
END;
.

If I run them separately, everything works fine.

We had the problem with multiple trigger inserts and therefore added the '.' at the end, but that hasn't solved the sequence problem.

Any help is very much appreciated!

Steve
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2005
Added on Sep 29 2005
4 comments
328 views