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

Re: DBI fails to return an error code

by jdrago999 (Pilgrim)
on Oct 04, 2011 at 20:30 UTC ( #929670=note: print w/ replies, xml ) Need Help??


in reply to DBI fails to return an error code

I am currently stumped.

Are you using RaiseError => 1 when you connect?

my $dbh = DBI->connection('DBI:mysql:db:localhost', 'user', 'pass', { RaiseError => 1 });


Comment on Re: DBI fails to return an error code
Select or Download Code
Re^2: DBI fails to return an error code
by djten (Novice) on Oct 09, 2011 at 01:34 UTC

    I had not tried that before, so I added that in. Then I created an error on purpose in one place in my code (an unknown column name).

    On my desktop machine, it threw the error to the Perl "software error" handling (bypassing my error display subroutine entirely), and reported:

    "DBD::mysql::st execute failed: Unknown column 'DCredits' in 'field list'".

    Exactly right!

    On my laptop, it still tried to run my error display subroutine, with the error code and string still blank (no difference there), and Perl's "software error" reported:

    "DBD::mysql::st fetchrow_array failed: fetch() without execute()".

    Which was not the actual problem, really, so no help there.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (17)
As of 2014-08-22 16:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (161 votes), past polls