Hi Perl Monks

I'm trying to find a way to send an array to a stored sql procedure which interprets it as an cursor, i.e., example:

my @player_list = ('john','peter','mary','joseph'); #Prodedure $sth = $dbh->prepare(q(BEGIN :ret := Proc.getPlayerIds(:in_player_list +,:out_list_ids);END;) $sth->bind_param_inout(':ret',\$ret, 1024); $sth->bind_param(':in_player_list', \@player_list, 0, {ora_type => ORA +_RSET}) or croak sth->errstr; $sth->bind_param_inout('::out_list_ids', \$ids, 0, {ora_type => ORA_RS +ET}) or croak sth->errstr;

However, if i do this, i get the following error:

Uncaught exception form user code: DBI bind_param: invalid number of arguments: got handle +4, expected + between 1 and 2

My question is, how do I convert my array to a cursor, or how do i send it directly to the procedure?

Can anyone help me? Thanks


In reply to Send array to SQL procedure as a cursor by Anonymous Monk

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.