REF CURSOR with Perl DBI

From: Lee <lee_at_jamtoday.com>
Date: Sun, 10 Mar 2002 13:06:23 -0500
Message-ID: <0f7n8ugf9ha7e40av0uiuo8l50ajonmllj_at_4ax.com>



[Quoted] Some people posting here seem to have some experience with the Perl DBI and oracle.

Will the perl DBI support Oracle's REF CURSOR . I'ld like to call a pl/sql stored procedure which returns a ref cursor as an output argument. Imaging a package interface like:

<never mind the pre-amble, create pacakge blah .....>
TYPE ref_Cursor_type is REF CURSOR

sum_proc( i_arg1 IN varchar2,

                       .... ,
                       i_argn IN varchar2,
                       o_results OUT ref_cursor_type);
-- -------------------------------------------------------------
-- Takes n input args, returns one ref cursor with lets say 3 varchar2
-- cols, (colA, colB, col C )
-- --------------------------------------------------------------

<end of snippet>

Now I want to call this from perl, binding some perl variable to i_arg1 thru i_argn and accepting o_result back.

Then of course, I want to fetch all the individual rows from o_result, and put the cols of o_result into local variables ($a, $b, $c ) , either one row at a time, or as an array bind (but thats a nice-to, not a must-to).

Any hope? (sample code would be nice),

 If not, what do people use as a workaround? I suppose I could always have the packaged procedure dump stuff into a "result" table and then have perl select the cols of the result table. Crude, but it would do the job. Received on Sun Mar 10 2002 - 19:06:23 CET

Original text of this message