Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Returning an array from a procedure/ function
"Simon Davies" <a_person_uk_at_yahoo.co.uk> wrote in message
news:6238724c.0307040746.65536382_at_posting.google.com...
> I'm struggling to work out how to return an array(table) from a pl/sql
> function/procedure. I have tried various methods using both functions
> and procedures.
>
> I currently have the following code:
>
> * Package *
>
> CREATE OR REPLACE PACKAGE MyPackage as
> TYPE ARRAY IS TABLE OF VARCHAR2(250);
> PROCEDURE MyProcedure(MyArray IN OUT ARRAY);
> END;
> /
>
> CREATE OR REPLACE PACKAGE BODY MyPackage IS
> PROCEDURE MyProcedure(MyArray IN OUT ARRAY) is
> BEGIN
> <snipped>
> END;
> END;
> /
>
> * Procedure Call *
> DECLARE
> TYPE ARRAY IS TABLE OF VARCHAR2(250);
> MyArray ARRAY :=
LOGIN_AREA('','','','','','','','','','','','','','','');
> BEGIN
> MySchema.MyPackage.MyProcedure(MyArray);
> END;
>
> ***
>
> Do excuse the poor quality of the above code. I haven't been doing
> this very long. All suggestion and critism greatly recieved.
>
> Cheers Simon
i follow the syntax, but what is the error your getting? or what is being
returned? are you printing out the
content of the PL/SQL table to see if the values are return?
im assuming your coming from an Object oriented backgroudn because
MyArray ARRAY := LOGIN_AREA('','','','','','','','','','','','','','','');
as a constructor. its not necessary. Arrays are wrapped in Oracle. Initialization is taken care of for you.
please provide more detail. Received on Sun Jul 06 2003 - 20:52:18 CDT