List:General Discussion« Previous MessageNext Message »
From:Jerry Preeper Date:October 12 2000 12:47am
Subject:multiple actions on dbh prepare / execute failure
View as plain text  
I'm having a bit of brain fade on this one... 
I'm working on an area of a program that does something like this

$query = SELECT Keyword FROM Boards
  $sth = $dbh -> prepare ($query) or main::not_right("Query syntax error:
$DBI::errstr. Query: $query");
  $sth -> execute() or main::not_right("Can't execute query: $query.
Reason: $DBI::errstr");

What I want to do is if the prepare or execute query fails, instead of the
above lines, I want to do something like this:

$sth = $dbh -> prepare ($query) or ...
print "Line $counter: Query syntax error: $DBI::errstr. Query: $query: Not
imported.<br>\n";
$counter++;
$err_cnt++;
next;


But I don't know how to get all these actions into the failure function.
Can anyone lend a hand...

Jerry

Thread
multiple actions on dbh prepare / execute failureJerry Preeper12 Oct
  • Re: multiple actions on dbh prepare / execute failureRyan Wahle12 Oct