Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Place holders in SQL query

by mje (Curate)
on Oct 10, 2014 at 15:41 UTC ( [id://1103435]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Place holders in SQL query
in thread Place holders in SQL query

my @states = map {$_->{state}} @$citydata; . . exec_select(sql, @states);

Replies are listed 'Best First'.
Re^4: Place holders in SQL query
by Anonymous Monk on Oct 10, 2014 at 17:43 UTC
    It worked!
    my $citydata = $dbh->exec_select( "select city,state from mytable whe +re city = ?", $city ); my @states = map {$_->{state}} @$citydata; my $statedata = join ' OR ', map { "state = ?" } @$citydata; my $codedata = $dbh->exec_select( "select code from othertable where +(year=2014 and ($statedata)), @states );

    Thanks for the help!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2026-04-10 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.