See RT which started this 

DBD::ODBC optimises calls to the do method when no parameters are involved. 
Normally do is just a shortcut for prepare/execute except it should only be for 
non-result-set generating statements and hence does not return a statement 
handle. ODBC can optimise the do method to simply call SQLExecDirect instead of 
the normal SQLPrepare/SQLExecute (one round trip and other advantages). 
DBD::ODBC has been this way for years.

However, the person reporting this issue is attempting to use the handle passed 
to an error handler when do fails to obtain the Statement attribute. The handle 
DBD::ODBC passes in to the error handler is the connection handle as DBD::ODBC 
never created a DBI statement handle and hence there is no Statement attribute 
to access.

Is DBD::ODBC breaking the rules here with this optimisation?

Martin J. Evans
Easysoft Limited

Reply via email to