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!

ORA-22160: element at index name does not exist

302357Sep 19 2004 — edited Sep 21 2004
hi

i have a procedure which insert values from a VARRAY type in a table. My question is how can i verify the existence of nth element before inserting to avoid ORA-22160: element at index name does not exist

Here is my code:

CREATE OR REPLACE PACKAGE BODY CANDIDE.PE_CL IS

PROCEDURE p_proc(Id_clt IN P_CLIENT.id_client%TYPE,
nameClt IN P_CLIENT.nameclient%TYPE,
--VARRAY type
priceItem IN price_array,
--VARRAY type
nameItem IN item_array) IS

BEGIN
INSERT INTO P_CLIENT VALUES (Id_clt, nameClt);
FORALL i IN nameItem.FIRST .. nameItem.LAST
INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), priceItem(i));
END;

end PE_CL;

Product version: Oracle9i Enterprise Edition Release 9.2.0.1.0

Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2004
Added on Sep 19 2004
9 comments
5,208 views