problem with DBD::ADO
Xiao Yafeng <[email protected]> Wed, 3 Aug 2011 16:10:28 +0800
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <CABPUXgDqTPVcTEgf+XNq4kZ-3pk70NR7nMbzEePwadCDBon3DQ@mail.gmail.com> |
Hello,
I've used DBD::ADO module lately, but stuck at the beginning.
below is test code:
# use DBD::Oracle
use DBI;
my $dbh = DBI->connect("dbi:Oracle:adas", 'adas', 'adas', {
"RaiseErro+r" => 1 } ) or die $DBI::errstr;
#my $dbh = DBI->connect("dbi:ADO:Provider=OraOLEDB.Oracle;Data
Source=+adas;", 'adas', 'adas', { "RaiseError" => 1 } ) or die
$DBI::errstr;
#DBI->trace(1, 'dbitrace.log');
my $sql = "SELECT sysdate FROM dual";
my $sth = $dbh->prepare( $sql );
$sth->execute();
print $sth->fetchrow_array; # no any problems!!
#use ADO instead
use DBI;
#my $dbh = DBI->connect("dbi:Oracle:adas", 'adas', 'adas', {
"RaiseErr+or" => 1 } ) or die $DBI::errstr;
my $dbh = DBI->connect("dbi:ADO:Provider=OraOLEDB.Oracle;Data
Source=a+das;", 'adas', 'adas', { "RaiseError" => 1 } ) or die
$DBI::errstr;
DBI->trace(1, 'dbitrace.log');
my $sql = "SELECT sysdate FROM dual";
my $sth = $dbh->prepare( $sql );
$sth->execute();
print $sth->fetchrow_array;
__OUTPUT__
DBD::ADO::st execute warning: Can't Execute Command 'SELECT sysdate FR+OM dual'
Package : DBD::ADO::st
Filename : C:\strawberry\perl\site\lib/DBD/ADO.pm
Line : 1244
Description : Multiple-step operation completed with one or
mo+re errors.
Check each status value.
HelpContext :
HelpFile :
NativeError :
Number : 265946
Source : OraOLEDB
SQLState :
at test_ADO.pl line 9.
DBD::ADO::st fetchrow_array failed: Statement handle not marked as
Act+ive. at te
st_ADO.pl line 11.
DBD::ADO::st fetchrow_array failed: Statement handle not marked as
Act+ive. at te
st_ADO.pl line 11.
__dbitrace.log__
DBI 1.616-ithread default trace level set to 0x0/1 (pid 4504 pi
3e3e+8c) at test_ADO.pl line 6
<- prepare('SELECT sysdate FROM dual')= ( DBI::st=HASH(0xcba1ac)
)+ [1 items] at test_ADO.pl line 8
!! warn: 0 'Can't Execute Command 'SELECT sysdate FROM dual'
Package : DBD::ADO::st
Filename : C:\strawberry\perl\site\lib/DBD/ADO.pm
Line : 1244
Description : Multiple-step operation completed with one or
mo+re errors. Check each status value.
HelpContext :
HelpFile :
NativeError :
Number : 265946
Source : OraOLEDB
SQLState :
' (err#0)
<- execute= ( undef ) [1 items] at test_ADO.pl line 9
!! warn: 0 CLEARED by call to fetchrow_array method
!! ERROR: -900 'Statement handle not marked as Active.' (err#1)
<- fetchrow_array= ( ) [0 items] row-1 at test_ADO.pl line 11
ERROR: -900 'Statement handle not marked as Active.' (err#1)
<- DESTROY(DBI::st=HASH(0xcba1bc))= ( undef ) [1 items] at
test_AD+O.pl line 11
ERROR: -900 'Statement handle not marked as Active.' (err#0)
<- FETCH('Active')= ( 1 ) [1 items] at ADO.pm line 996
!! ERROR: -900 CLEARED by call to disconnect method
<- disconnect= ( 1 ) [1 items] at ADO.pm line 996
<- DESTROY(DBI::db=HASH(0xcb9c9c))= ( undef ) [1 items] at
test_AD+O.pl line 11
!! ERROR: -900 CLEARED by call to disconnect_all method
<- disconnect_all= ( ) [0 items] (not implemented) at DBI.pm line +744
! <- DESTROY(DBI::dr=HASH(0xcb966c))= ( undef ) [1 items] during
glo+bal destruction
[download] <http://www.perlmonks.org/?abspart=1;displaytype=displaycode;node_id=917939;part=1>
Any helps? Thanks in advance.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs