I'm currently in the middle of rewriting some tools. I "want" to use Oracle Stored Procedures as much as possible. I nailed down calling them, and bringing back 1 row of data, but am stuck on how to return multiple rows of data back. So far I have tried two methods

(1) Binding a cursor for which I get the following error

Can't bind :module_cursor, ora_type 0 not supported by DBD::Oracle at c:\Program Files\Apache Group\Apache\cgi-bin\techArchUtilityModules/OracleUtility.pm line 112.

whose code line looks like:

$csr = $dbh->prepare("BEGIN get_junk(:module_cursor);END;");

$csr->bind_param_inout(":module_cursor", \$sth2, 0, { ora_type => ORA_RSET } );

(2) I've tried using the selectall_arrayref which if I'm reading the DBD documenation right should work, but I can't figure out the syntax on it... ie it nukes it self in place...

So I kind of stuck on where to go... I've used DBMS_OUTPUT in reports in the past... not sure if there is an option in perl...

Curious to hear if anyone has had any luck running stored procs. I guess worst case scenario I have to punt and put all my sql in a common module...

CHEERS


In reply to Oracle Stored Procs - DBD - How to return multiple rows by pdt1630

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.