Home » Open Source » Programming Interfaces » binding a user-defined Oracle type...
binding a user-defined Oracle type... [message #397451] Fri, 10 April 2009 18:04 Go to next message
andrewkl
Messages: 9
Registered: November 2007
Junior Member
hi

I created a user-defined Oracle datatype:

  CREATE OR REPLACE TYPE string_varray AS VARRAY(500) OF VARCHAR2(4000);


here's the stored procedure:

  PROCEDURE save_multiple_values
  (
     array_values  IN string_varray
  );



How can I bind my user-defined type in Perl/DBI and pass the data to my stored procedure from a perl script?


  @avals = qw(this is a test);

  $sql = 'BEGIN my_package.save_multiple_values(:array_vals); END;';

  my $stmt = $dbh->prepare ($sql);

  $stmt->bind_param_array(":array_vals", \@avals);
  $stmt->execute;



what I run my perl script, I get the following error:

DBD::Oracle::st bind_param_array failed: Can't use named placeholder ':array_vals' for non-driver supported bind_param_array [for Statement "BEGIN my_package.save_multiple_values(:array_vals); END;" with ParamValues: :array_vals=undef] at ./demo.pl line 58.
DBD::Oracle::st execute failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute) [for Statement "BEGIN my_package.save_multiple_values(:array_vals); END;" with ParamValues: :array_vals=undef] at ./demo.pl line 59.


I am using these versions:

DBD::Oracle::VERSION=1.16
DBI::VERSION=1.46


Thanks
--Andrew
Re: binding a user-defined Oracle type... [message #397452 is a reply to message #397451] Fri, 10 April 2009 18:33 Go to previous messageGo to next message
BlackSwan
Messages: 25039
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Please, please, please Read & Follow Posting Guidelines above.
Go to the section labeled "Practice" & do as directed.

You are supposed to SEARCH before posting!

http://www.issociate.de/board/post/368660/ANNOUNCE:_Advanced_DBI_Tutorial_Slides.html
Re: binding a user-defined Oracle type... [message #397454 is a reply to message #397451] Fri, 10 April 2009 21:02 Go to previous messageGo to next message
andrewkl
Messages: 9
Registered: November 2007
Junior Member
sorry... i did try searching on "bind" and "array", but there
were too many results.
Re: binding a user-defined Oracle type... [message #397456 is a reply to message #397451] Fri, 10 April 2009 22:02 Go to previous message
BlackSwan
Messages: 25039
Registered: January 2009
Location: SoCal
Senior Member
I GOOGLED bind_param_array

You could have also RTFM by using the perldoc utility;
which is essentially the online PERL reference manual.
Previous Topic: Please Help.....PHP Apache Crashes....
Next Topic: OCILOGON
Goto Forum:
  


Current Time: Tue Dec 06 06:16:03 CST 2016

Total time taken to generate the page: 0.10425 seconds