create or replace type myiarray_int as varray(10) of int;  --首先自定义了一个类型 int 型数组
----------------------------------------------------要实现的是点击下订单的时候,自动从购物车表里面取出商品的id和商品的数量
create or replace procedure put_into_detail(gid_of_ci in myiarray_int ,count_of_ci int myiarray_int ,var_bid in varchar(32))
                                                         --商品编号(一或多)  商品数量(一或多) 买家(一个)
is
declare var_oid int;
begin
insert into orders(bid,ostatus) values(var_bid,'未付款'); --新增一条订单记录
var_oid := seq_orders_oid.currval;    --把订单值赋给一个变量
for x in 1..gid_of_ci.count loop    --对于每种商品
--insert into detail(oid,gid,quantity) values(var_oid,gid_of_ci(x),count_of_ci(x)); --添加到详单中
insert into detail(oid,gid,quantity) values(seq_orders_oid.currval,gid_of_ci(x),count_of_ci(x));
delete from cartitem where cid in(select cid from cart where bid=var_bid) and gid=gid_of_ci(x);--删除该购物车对应的商品 
end loop;
end;
语句一条一条的十好像都没什么问题,整合成存储过程 就出错,搞了几天了,求大神!!!谢谢