Getting hold of the current (Sybase) database when using the DBI

Edwardson, Tony Tony.Edwardson at
Tue Feb 12 01:10:37 PST 2008

We have a infrequent error occuring where an Sybase sql statement
occasionally reports a database object doesn't exist when it clearly does
[2008/02/07 20:28:34]            DEBUG - 46747  - select runtime
from ab_books where book = ? and batch = ? and status = 'FINISHED' order by
[2008/02/07 20:28:34]            DEBUG - 46747  - Server message:
Message number: 208, Severity 16, State 1, Line 1
Server 'mint' Procedure 'DBD1687'
Message String: ab_books not found. Specify owner.objectname or use sp_help
to check whether the object exists (sp_help may produce lots of output).
[2008/02/07 20:28:34]            ERROR - 46747  - SQL prepare

The Perl code producing this frequently switches between databases (with a
use statement) and we suspect that the error is caused by a use statement
failing silently and so is looking on the wrong database for the object.
Anyone know of a way of reliably obtaining the current database context with
a DBI database of statement handle ?
I have already suggested adding " {syb_show_sql => 1}" to the conenction
statement to include the actual sql being run in the DBI::errstr (in case
the problem is due to the parameters passed inn the place holders.

This is a commercial communication from Commerzbank AG.

This communication is confidential and is intended only for the person to
whom it is addressed.  If you are not that person you are not permitted to
make use of the information and you are requested to notify
<mailto:LONIB.Postmaster at> immediately that you have
received it and then destroy the copy in your possession.

Commerzbank AG may monitor outgoing and incoming e-mails. By replying to
this e-mail you consent to such monitoring. This e-mail message and any
attached files have been scanned for the presence of computer viruses.
However, you are advised that you open attachments at your own risk.

This email was sent either by Commerzbank AG, London Branch, or by
Commerzbank Corporates & Markets, a division of Commerzbank. Commerzbank AG
is a limited liability company incorporated in the Federal Republic of
Germany. Registered Company Number in England BR001025. Our registered
address in the UK is 60 Gracechurch Street, London, EC3V 0HR. We are
regulated by the Financial Services Authority for the conduct of investment
business in the UK and we appear on the FSA register under number 124920. 


-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MiltonKeynes-pm mailing list