pl/sql table insertion error

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
shekhar_lonkar
Posts: 12
Joined: Mon Mar 26, 2007 4:21 am
Location: India

pl/sql table insertion error

Post by shekhar_lonkar »

Dear all friends
i m facing problem in following package....

my requirement is such as

i have to pass the a tem pl/sql tabe to the oracle apps oe_order_pub.process_order api as a input for inventory item.


for that purpose have created xx_xart table.

i have created one packege, as follows
create or replace package xx_my_cart as
procedure pop_table ( P_custid number);
end;
/

create or replace package body xx_my_cart
as
my_cart oe_order_pub.Line_Tbl_Type;
i number ;
procedure pop_table ( P_custid NUMBER) as
--item oe_order_pub.p_line_rec.inventory_item_id;
CURSOR my_cur (p_custid number ) IS
select item_id from xx_cart WHERE CUST_ACCT_ID = p_custid;
begin
for my_item IN my_cur(P_custid)
loop
i := i +1;
EXIT WHEN my_cur%NOTFOUND;
dbms_output.put_line(to_char(my_item.item_id));
my_cart(i).inventory_item_id := my_item.item_id;

end loop;
end; -- end of procedure
end; -- end of package

sql>set serveroutput on

SQL> exec xx_my_cart.pop_table (1290);
2636
BEGIN xx_my_cart.pop_table (1290); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value
ORA-06512: at "APPS.XX_MY_CART", line 15
ORA-06512: at line 1

my xx_cart contains
SQL> select * from xx_cart;

CART_ID CUST_ACCT_ID ITEM_ID QTY PRICE PR
--------- ------------ --------- --------- --------- --
101 1290 2636 100 100 NP
102 1290 245 20 50 NP
100 1290 7977 2 100 NP

i am unable to insert into the my_cart pl/sql table.

pls give me a solution.

Awaiting for reply.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest