View Full Version : Oracle 9i forms sequence + pre-insert form trigger
A.barth
09-05-2003, 05:42 AM
Hi,
I think the use of a bind variable is not the right choice.
Replacing that by a normal variable (declared before the BEGIN) should
fix your problem.
For example:
CREATE SEQUENCE count_seq
INCREMENT BY 1
START WITH 1
MAXVALUE 999999
NOCYCLE;
create or replace TRIGGER "USER".mytrigger1
AFTER INSERT
ON mytable1
FOR EACH ROW
declare
l_id NUMBER;
BEGIN
SELECT count_seq.nextval INTO l_id FROM dual;
INSERT INTO mytable2 values (l_id);
END;
/
--
Posted via http://dbforums.com
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.