Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^2: DBI: checking if a table exists in a cross-DB manner?
in thread DBI: checking if a table exists in a cross-DB manner?

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
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

  • Comment on Re^3: DBI: checking if a table exists in a cross-DB manner?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://411976]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found