Hi,
I'm uising DBI and i will know, how can i do , to check if the connexion failed ?
I use this
my $dbh = DBI->connect("dbi:Oracle:$db", $user, $pass);
If my connection failed , i want to get the return code and print the connexion failed.
sommething like this
if ($code <> 0) then
{
print "connexion failed";
}
If i do a query :
my $sth=$dbh->prepare($query);
$sth->execute();
and the query failed because a problem of connexion,i want to get the error code or message , and print it.
Is it possible ???
Thanks
I'm uising DBI and i will know, how can i do , to check if the connexion failed ?
I use this
my $dbh = DBI->connect("dbi:Oracle:$db", $user, $pass);
If my connection failed , i want to get the return code and print the connexion failed.
sommething like this
if ($code <> 0) then
{
print "connexion failed";
}
If i do a query :
my $sth=$dbh->prepare($query);
$sth->execute();
and the query failed because a problem of connexion,i want to get the error code or message , and print it.
Is it possible ???
Thanks