Assuming an object in PL/SQL on Oracle:
CREATE OR REPLACE TYPE myObj AS OBJECT ( Col1 number, Col2 varchar(2), Col3 timestamp, ... Col57 number );
(Why an object? Because OCI programming doesn't allow PL/SQL RECORD type. ;)

And now here's what I'd LIKE to run. Is anything like this possible? I need to call a package function that takes IN this object. How can I bind perl variables to the PL/SQL object? I'm using PL/SQL to get at a package/function in the database. This function does post-processing on the object (which really just represents a row of data). We're all trying to avoid 57 bind variables. :)

my $sql = " DECLARE in_row myObj; retcode number; BEGIN :retcode := Otherpackage.Function(:in_row); END; "; my $sth = $dbh->prepare($sql) ...
My main question is... how do I bind a list or hash to :in_row in the $dbh->bind_param(":in_row", \%hash, ...);

-ArchFool


In reply to Objects in PL/SQL in DBD::Oracle by archfool

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.