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!

Handling 2D array in the PL/SQL.

492469Apr 27 2006 — edited Apr 27 2006
Hi,

I have been having a lot of trouble with executing a stored procedure. I'm hoping someone can help me with this:

The stored proc.One of these parameters coming in is a 2D array from the Java.
The data type of the 2D array is varchar.

I am able to create single dimension array in the PL./SQL after creating the below data type:

CREATE TYPE "TAB_ARR" AS VARRAY (3) OF NVARCHAR2(20);

Then I used this data type in my Stored Procedure as below :
**************************************************************************
CREATE OR REPLACE PROCEDURE "TEST"."ARRAY_TEST" (username varchar2,contractno varchar2,p_arr1 TAB_ARR,p_arr2 TAB_ARR) AS
BEGIN
FOR i IN p_arr1.FIRST..p_arr1.LAST
LOOP
INSERT INTO temp VALUES(username,contractno,p_arr1(i),p_arr2(i)); END LOOP;
END ARRAY_TEST;
**************************************************************************
can anybody has any clue to solve this problem.

Thanks a lot for any help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2006
Added on Apr 27 2006
1 comment
306 views