Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: DBI query where table name is a variable

by rdfield (Priest)
on Oct 23, 2007 at 08:28 UTC ( #646655=note: print w/replies, xml ) Need Help??


in reply to DBI query where table name is a variable

I would set the query up in a scalar first, then pass it to DBI:
my $sql = "select confidence_str from $table where probeset_id = ?"; if (!$dbh->prepare($sql)) { warn "error parsing SQL: $sql\n". $dbh->errstr; return; } if (!$dbh->execute($param)) { warn "error executing SQL: $sql\nparam $param\n". $dbh->errstr; return; }
or something like it.

rdfield

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://646655]
help
Chatterbox?
[Discipulus]: iirc i took some interesting guitar link from your homenode
[marioroy]: nice karlgoethebier guitar links on your homenode.
[marioroy]: The nature of the Guitar
[Discipulus]: my best with guitar is to fingerpicking some De André songs
[karlgoethebier]: Listen to Glenn: https://www. youtube.com/watch? v=SiiVK3rMxxg

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-03-24 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (298 votes). Check out past polls.