exec a procedure with a sequence?
575745May 7 2007 — edited May 8 2007Here 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