
Binding Cursors returned from PL/SQL stored procedure
====================
Binding Cursors
---------------
Following code i got from this site
http://www.*-*-*.com/
Cursors can now be returned from PL/SQL blocks. Either from
stored procedure
OUT parameters or from direct OPEN statements, as show below:
use DBI;
use DBD::Oracle qw(:ora_types);
$dbh = DBI->connect(...);
$sth1 = $dbh->prepare(q{
???? BEGIN OPEN :cursor FOR
???????? SELECT table_name, tablespace_name
???????? FROM user_tables WHERE tablespace_name = :space
???? END;
Quote:
});
$sth1->bind_param(":space", "USERS");
my $sth2;
$sth1->bind_param_inout(":cursor", \$sth2, 0, { ora_type =>
ORA_RSET } );
$sth1->execute();
# $sth2 is now a valid DBI statement handle for the cursor
The only special requirement is the use of bind_param_inout()
with an
attribute hash parameter that specifies ora_type as ORA_RSET. If
you don't
do that you'll get an error from the execute() like: "ORA-06550:
line X,
column Y: PLS-00306: wrong number or types of arguments in call
to ...".
==========================
Here is my problem..
But it is not working for me . I am getting an error as follows..
"Can't bind :m_dispAcross_var, ora_type 0 not supported by DBD::Oracle
at Mytest.pm line 21414."
I want to return set of rows to Perl program & process them in perl
variables.
Any help highly appreciated
Anish
Sent via Deja.com http://www.*-*-*.com/
Before you buy.