andre_tux has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: DBI Oracle. how to pass a record as parameter to PL/SQL function
by mje (Curate) on Mar 27, 2009 at 17:03 UTC

      I have already gone through the DBD-Oracle documentation.
      So it would seem that what I want to do it not possible at the moment, due to the fact that we can only pass atomic parameters to a PL/SQL function.

      PS: I see that I have a typo in my example regarding the array. :-)

      Thanks