when the table does not exist the prepare fails.  How do ignore the error 
thrown by the prepare() and catch it later in the program?
 
 
my $dbh = DBI->connect("dbi:ODBC:mysql"  
                         ,$login 
                         ,$passwd
                         ,{ RaiseError => 0 }
                        );
...
$sth = $dbh->prepare("SELECT COUNT(*) FROM mytable");   # don't catch
 $retCode = $sth->execute();
if ($dbh->err) {
  print "Table $table -- DOES NOT EXIST\n";
}
....
 


      

Reply via email to