go ahead... be a heretic | |
PerlMonks |
Re^3: DBI: checking if a table exists in a cross-DB manner?by thor (Priest) |
on Dec 02, 2004 at 22:38 UTC ( [id://411976]=note: print w/replies, xml ) | Need Help?? |
Let's see what we can do. What about "select * from $table_name where 9=0"? For most db drivers that I know, that will either fail in the prepare or the execute if the table doesn't exist. You should be able to trap that error and act accordingly. Moreover, it won't actually fetch any data, so it's good from a data throughput standpoint. :)
thor
Feel the white light, the light within
In Section
Seekers of Perl Wisdom
|
|