我正在给我的代码的一小段代码,但在尝试为存储的Oracle PL SQL过程创建新订单时收到下面的错误消息。 第83行是代码中的插入语句,第84行是语句的插入部分。针对新的事务和订单的PL SQL存储过程
83/5 PL/SQL:SQL语句忽略
47分之84PL/SQL:ORA-00984:列在这里
BEGIN
--Initializing values for variables
x_rowcount := 0;
x_stockonhand := 0;
Totaldue := 0;
--Total due calculation
--(price of phone*quantity + shipping cost)*1.06 (assuming 6% sales tax)
Totaldue := (((i_price * c_p_qty) + i_shipping_cost) * 1.06);
SAVEPOINT start_transaction; -- mark a savepoint
--INSERT a new record into order table.
INSERT INTO orders(o_id,c_id,p_id,s_id,order_date,o_qty,order_total,card_type,cc_number,exp_date,shipping_status)
VALUES (orders_seq.nextval, c_c_id,c_p_id,s_id,sysdate,c_p_qty,Totaldue,c_card_type,c_cc_number,c_exp_date,'Not shipped yet');
认为您可能必须在插入前先获得序列。所以也许就像插入前从orders中选择orders_seq.nextval到myOrdersSeq中一样; (当然你需要定义myOrdersSeq) –