Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: DB Error Handling Not Working

by poj (Priest)
on Aug 13, 2014 at 19:13 UTC ( #1097331=note: print w/ replies, xml ) Need Help??


in reply to Re^2: DB Error Handling Not Working
in thread DB Error Handling Not Working

Sorry, the connection string should be DBI->connect($data_source, $username, $password, \%attr) so either use

my $dbh = DBI->connect("DBI:ODBC:$DSN",'','', {RaiseError => 1, PrintError => 1}) or die (Error connecting " $DBI::errstr");
or move the username/password out of the $DSN.
poj

Update : To get current date/time you could just use
my ($now) = $dbh->selectrow_array('SELECT CURRENT_TIMESTAMP');


Comment on Re^3: DB Error Handling Not Working
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-05 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls