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!

User-defined datatypes as IN variables in stored procedures

880372Aug 4 2011 — edited Aug 4 2011
Hello,

I'm trying to write a stored procedure which will accept a custom data type as an IN variable. Using the information here: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm I've set up a procedure which looks like this:

CREATE OR REPLACE PROCEDURE EDEPOSIT.merch_acct_proc_method_insert
(
arg_ALL_PROC_METHODS IN proc_array
)

IS

TYPE proc_array IS TABLE OF VARCHAR2 INDEX BY VARCHAR2;

BEGIN

arg_METHOD := arg_ALL_PROC_METHODS.first;
while (arg_METHOD is not null)
loop
--processing code
end loop;

END;

but I'm running into a problem where it seems that the data type needs to be defined before the parameters block (Error(3,27): PLS-00201: identifier 'PROC_ARRAY' must be declared), but a DECLARE block won't co-exist with the CREATE OR REPLACE command (PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: begin function pragma procedure subtype type <an identifier>).

What am I missing?

Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2011
Added on Aug 4 2011
6 comments
1,504 views