Hi,

We have a PL/SQL package that defines it's own RECORD data type.
This data type is then used as parameters for the functions in the package. We have a lot of possible parameters per function and most of the time only a few is affected so we created the custom record type so you can only use the fields that actually need to change.
This is also for maintanability so that we can easily add a new field without breaking stuff and keeping it backward compatible.

We also need to call the functions in the package from Perl. The data type is used to send data as well as retrieve data.

For example:

PL/SQL Package

TYPE t_tp_data IS RECORD ( t_the_id NUMBER, t_the_name VARCHAR2(200), ... ... ); FUNCTION add_data(v_data t_tp_data) RETURN NUMBER; FUNCTION upd_data(v_data t_tp_data) RETURN NUMBER; FUNCTION get_data(v_id NUMBER) RETURN t_tp_data;

In Perl, we define an array:

my $arr_data = { the_id => '', the_name => ''', ... ... };

Is it possible to pass the whole array to the PL/SQL function and use it as return variable?

I googled, but did not find anything that I can use.

Thanks
Andre

In reply to DBI Oracle. how to pass a record as parameter to PL/SQL function by andre_tux

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.