Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013931]
Discipulus hitting the edge: panic: gen_constant_list JMPENV_PUSH returned 2 at -e line 1.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2018-02-21 13:42 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (280 votes). Check out past polls.