Home  |  Linux  | Mysql  | PHP  | XML
From:Dr.Ruud Date:Fri Feb  5 09:23:36 2010
Subject:Re: prepare(SELECT ... FROM TABLE) error
Tony Esposito wrote:

> This question has never been answered. To out it another way, given the code ...
>
> foreach my $mytable (@mytables) {
> my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable");
> # report error but move on to next table
> }
>
> how do I ignore the situation/error that DBI throws when $mytable does not exist and just move on to the next table?

Why would you want to?

Why not just ask the database which tables are there?

If you really want to do it in an ugly way, then
first read "perldoc DBI" about "err" and "errstr"
and "RaiseError", etc.

--
Ruud
Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: 1-line text file with numbers, need to add to them
Re: Modeling FIFO financial transactions in Perl
stripped output from Net::SSH2
Re: Any Good SCM tool to manage Perl Code locally
Re: Any Good SCM tool to manage Perl Code locally



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants