bubnoff has asked for the wisdom of the Perl Monks concerning the following question:
I need to figure out whether a table is empty so I can send it to the appropriate subroutine. Using DBI with sqlite. The solution would appear to be:
When I print $empty, I get:my $empty = $dbh->do("SELECT count(*) FROM audio"); if ( $empty >= 1 ) { &processItem; } else { &noItems; }
automation@Sherman:~/Desktop/SQL_Scripts/output$ sudo perl parse_audio.pl 0E0I've looked here, the sqlite module documentation and at sqlite3 sites in general.
When I run the query via CLI I get the correct answer of 23.
I am overlooking something simple, I'm sure ...but what?
Thanks y'all!
Bubnoff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find empty tables - sqlite module
by Your Mother (Archbishop) on Dec 31, 2008 at 23:58 UTC | |
by bubnoff (Novice) on Jan 01, 2009 at 00:17 UTC | |
by Herkum (Parson) on Jan 01, 2009 at 02:15 UTC | |
by Marshall (Canon) on Jan 01, 2009 at 06:49 UTC | |
by Your Mother (Archbishop) on Jan 01, 2009 at 17:40 UTC | |
|
Re: Find empty tables - sqlite module
by Jenda (Abbot) on Jan 01, 2009 at 06:24 UTC |