Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: DBI query where table name is a variable

by duff (Vicar)
on Oct 22, 2007 at 15:41 UTC ( #646470=note: print w/ replies, xml ) Need Help??


in reply to DBI query where table name is a variable

Did you set $table before you called $dbh->prepare? Are you sure you set it correctly? There's a way to get DBI to tell you exactly what it sent to the SQL processor but I forget what it is. Perhaps another kind monk can enlighten you so you can see what the SQL processor sees.


Comment on Re: DBI query where table name is a variable
Select or Download Code
Replies are listed 'Best First'.
Re^2: DBI query where table name is a variable
by Fletch (Chancellor) on Oct 22, 2007 at 16:56 UTC

    Usually if you call $sth->trace( 2 ) (alternately call trace on your $dbh to enable tracing for all statement handles subsequently created) you should get a glimpse at the SQL that's being sent to the backend.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (16)
As of 2015-07-31 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls