DBD::Oracle::st fetchrow warning: (err=0, errstr=undef, state=undef)

问题: DBD::Oracle::st fetchrow warning: (err=0, errstr=undef, state=undef) at test.pl line 65.

1. 首先google到一个: http://coding.derkeiler.com/Archive/Perl/perl.dbi.users/2005-12/, 进去是一堆的DBD::Oracle问题和答案.

2. 可以看到DBD::Oracle的作者Tim.Bunce 关于这个问题的解答: http://coding.derkeiler.com/Archive/Perl/perl.dbi.users/2005-12/msg00205.html

..

That was fixed in 1.16. The Changes file says:

Fixed setting of $DBI::err to 0 triggering PrintWarn in DBI >= 1.41.

3. 但是这个答案不能解决我的问题: 因为我无法更新DBD::Oracle (没有系统权限!).

C:me>ppm
PPM interactive shell (2.2.0) – type ‘help’ for available commands.
PPM> install DBI
Version 1.53 of ‘DBI’ is already installed.
Remove it, or use ‘verify –upgrade DBI’.
PPM> install DBD::Oracle
Version 1.12 of ‘DBD-Oracle’ is already installed.
Remove it, or use ‘verify –upgrade DBD-Oracle’.
PPM> verify –upgrade DBD-Oracle
Upgrade package ‘DBD-Oracle’? (y/N): y
While verifying package ‘DBD-Oracle’: Could not locate a PPD file for DBD-Oracle

PPM> set repository x5 http://theoryx5.uwinnipeg.ca/ppmpackages/
PPM> set
Commands will be confirmed.
Temporary files will be deleted.
Download status will be updated every 16384 bytes.
Case-insensitive searches will be performed.
Package installations will continue if a dependency cannot be installed.
Tracing info will not be written.
Screens will pause after 24 lines.
Query/search results will be verbose.
Current PPD repository paths:
x5: http://theoryx5.uwinnipeg.ca/ppmpackages/
ActiveState Package Repository: http://ppm.ActiveState.com/cgibin/PPM/pp
mserver.pl?urn:/PPMServer
Packages will be built under: C:DOCUME~1***Local SettingsTemp2
HTML documentation will not be rebuilt after installing each package.
PPM> verify –upgrade DBD::Oracle
Upgrade package ‘DBD-Oracle’? (y/N): y
While verifying package ‘DBD-Oracle’: Could not locate a PPD file for DBD-Oracle

4.我发现了一个非常简单的workaround:

$dbh = DBI->connect(‘dbi:Oracle:’,$connectstring,$variable_value{’password’}, { AutoCommit => 0, PrintWarn=> 0 } );

好了!

Advertisements

About Pang

Oracle DBA working in database, fusion middleware and identity management and cloud.
This entry was posted in Perl. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s