Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Reaped: Re: DBI fails to return an error code

by dmz (Novice)
on Jan 18, 2013 at 01:11 UTC ( #1013931=note: print w/ replies, xml ) Need Help??


in reply to Reaped: Re: DBI fails to return an error code
in thread DBI fails to return an error code

Don't know if its bad form to revive this post but I have found a sort of workaround. Note that this is the top link on google search, so its still relevant imho.

Having finally said goodbye to XP I have had the same problem and it's kicking my butt. Not having errors kick out is very inconvenient, not to mention possibly professionally dangerous! Also adding in die to the execute call creates a false negative!

All my research points to it being a bug with Windows 7 64 bit. Having just upgraded EVERYTHING in my cpan collection, it looks like its still live.

The (partial) workaround I found is to call $DBI::rows if $DBI::rows is <0 - specifically -1 then the sql call failed. if it is positive then the call is OK. Have it print out your SQL to the console if -1 and test it in myphpamin or whatever to get the error.

Point is, for insert/update at least its a reliable way to at least get some idea of how your statement worked!

Now I haven't tested much further than inserting. But I imagine that in other cases it should perform in a similar way.

It's not groundbreaking, I know, but I hope it helps someone else who banged their head against the wall over this!


Comment on Re: Reaped: Re: DBI fails to return an error code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013931]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-10-24 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (134 votes), past polls