Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> cursors and perl DBD::Oracle

cursors and perl DBD::Oracle

From: <mchavel_at_kenan.com>
Date: 2000/04/26
Message-ID: <8e75rc$brj$1@nnrp1.deja.com>#1/1

using the perl module DBD::Oracle
i can use bind_param_inout to fetch from a cursor, but i haven't figured out how to close the cursor. They seem to persist until i disconnect from the database.

here is my perl code:

sub execute_function {

    my ($func_name, @params_in) = @_;
    my ($params, $sth, $curh);

    for (0..$#params_in) {

        $params .= ":in$_, ";
    }
$params = substr($params, 0, -2);

$sth = $dbh->prepare(qq{

        BEGIN :curout := $func_name($params); END;     }) or warn($dbh->errstr);

$sth->bind_param_inout(":curout", \$curh, 1, { ora_type =>
ORA_RSET } );
    for (0..$#params_in) {

        $sth->bind_param(":in$_", $params_in[$_]);     }
$sth->execute() or warn($dbh->errstr);
$sth->finish;

    DBI::dump_results($curh);

$curh->finish;

}

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Apr 26 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US