Passing an array of data as an input parameter to an Oracle procedure

Posted by Sathya on Stack Overflow See other posts from Stack Overflow or by Sathya
Published on 2010-05-21T21:05:18Z Indexed on 2010/05/21 21:30 UTC
Read the original article Hit count: 263

Filed under:
|
|

I'm trying to pass an array of (varchar) data into an Oracle procedure. The Oracle procedure would be either called from SQL*Plus or from another PL/SQL procedure like so:

BEGIN
 pr_perform_task('1','2','3','4');
END;

pr_perform_task will read each of the input parameters and perform the tasks.

I'm not sure as to how I can achieve this. My first thought was to use an input parameter of type varray but I'm getting Error: PLS-00201: identifier 'VARRAY' must be declared error, when the procedure definiton looks like this:

CREATE OR REPLACE PROCEDURE PR_DELETE_RECORD_VARRAY(P_ID VARRAY) IS

To summarize, how can I pass the data as an array, let the SP loop through each of the parameters and perform the task ?

I'm using Oracle 10gR2 as my database.

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about plsql