Skip to Main Content

SQL & PL/SQL

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!

exec a procedure with a sequence?

575745May 7 2007 — edited May 8 2007
Here is my code. And the error I get when trying to insert into a table using a sequence can't figure out what im doing wrong?



create or replace procedure basket_add_sp
(p_baskid IN number, p_prodid IN number,
p_price IN number, p_qua IN number,
p_sizecode IN number, p_formcode IN number)


IS




BEGIN






INSERT into bb_basketitem (idbasketitem,idproduct, price, quantity, idbasket, option1, option2)
VALUES (bb_idbasketitem_seq.nextval ,p_prodid, p_price, p_qua, p_baskid, p_sizecode, p_formcode);







END;





**********************************************************************************************
ERROR:

SQL> exec basket_add_sp(bb_idbasketitem_seq.nextval, 8, 10.80, 1, 15, 2, 4);
BEGIN basket_add_sp(bb_idbasketitem_seq.nextval, 8, 10.80, 1, 15, 2, 4); END;

*
ERROR at line 1:
ORA-06550: line 1, column 41:
PLS-00357: Table,View Or Sequence reference 'BB_IDBASKETITEM_SEQ.NEXTVAL' not allowed in this context
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2007
Added on May 7 2007
10 comments
827 views