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

Re: PERL DBI MODULE

by Tux (Monsignor)
on May 19, 2014 at 13:44 UTC ( #1086664=note: print w/ replies, xml ) Need Help??


in reply to PERL DBI MODULE

As said by others, your quest is kinda dubious.

My first warning/quest after reading the OP is: "Do you really mean to match coln1 against a literal '?'?

If you want to match against a parameter in the execute that will not DWIM at all.

my %sth = map { $_ => $dbh->prepare ("select * from foo where $_ = ?") + } qw( coln1 coln2 coln3 ); # Note the unquoted ? $sth{coln1}->execute ($coln1_val); # query for coln1 executed with ? r +eplaced with $coln2_val

Enjoy, Have FUN! H.Merijn


Comment on Re: PERL DBI MODULE
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-07-04 14:03 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 (60 votes), past polls