Re: Cursors: Can this DBI::Oracle code be converted to DBI::OCDB?
- From: "telesphore4@xxxxxxxxx" <telesphore4@xxxxxxxxx>
- Date: 12 Apr 2007 15:47:39 -0700
On Apr 11, 6:08 pm, "telespho...@xxxxxxxxx" <telespho...@xxxxxxxxx>
wrote:
The following code sample works just fine as it is. However, I need to
convert it so that it uses DBI::OCDB. Is this possible?
use strict;
use DBI;
use DBD::Oracle qw(:ora_types);
my $dbh = DBI->connect( 'dbi:Oracle:dsn', 'user', 'password' );
my $sth1 = $dbh->prepare(q{
BEGIN OPEN ? FOR
SELECT * FROM user_tables WHERE table_name like ?;
END;
});
my $sth2;
$sth1->bind_param( 2, $ARGV[0] );
$sth1->bind_param_inout( 1, \$sth2, 0, { ora_type => ORA_RSET } );
$sth1->execute;
while ( my @row = $sth2->fetchrow_array ) {
print "$row[0]\n";
}
$dbh->disconnect;
Google and the docs aren't helping here. I know that there is some
allowance for cursors in the ODBC because of the odbc_cursortype =>
DBI::SQL_CURSOR_DYNAMIC option. So there should be a way to do this.
So if some one can give me the correct syntax for binding an ODBC
cursor on ANY PLATFORM (Oracle, SQL/Server, etc.) even that would be a
huge help.
$sth1->bind_param_inout( 1, \$sth2, 0, { ora_type => ORA_RSET } );
Obviously, ora_type is wrong for ODBC but is there is an equivalent?
It looks like i might have to dig into the c source code if I can't
get an answer soon.
.
- References:
- Cursors: Can this DBI::Oracle code be converted to DBI::OCDB?
- From: telesphore4@xxxxxxxxx
- Cursors: Can this DBI::Oracle code be converted to DBI::OCDB?
- Prev by Date: Is DBI::Shell still maintained?
- Next by Date: Re: DBI and perl 5.6.2
- Previous by thread: Cursors: Can this DBI::Oracle code be converted to DBI::OCDB?
- Next by thread: DBD::Oracle Install Fails on Gentoo Linux
- Index(es):
Relevant Pages
|
|