Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Re: DBI Error Trapping

by htoug (Deacon)
on Dec 19, 2001 at 12:15 UTC ( [id://133055]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: DBI Error Trapping
in thread DBI Error Trapping

Try something like:
{ local $db3->{RaiseError}=0; $sth_minus = $db3->prepare_cached(" SELECT $column_list FROM $database_user_1.$table_names_r->[0]". +'@'."$config{database_dblink_1} MINUS SELECT $column_list FROM $database_user_2.$table_names_r->[0]". +'@'."$config{database_dblink_2} "); warn "prepare fails with $db3->errstr" if $db3->err; }
The errorcode is returned in $db3->err and the string in $db3->errstr not in $@.

Localising $db3->{RaiseError} is a way of locally setting the RaiseError attribute without having to rembember the state (probably not needed here, but it is a useful idiom :-).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found