Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: DBI parameterized database query with comma seperated list

by kennethk (Abbot)
on Dec 18, 2015 at 21:43 UTC ( #1150720=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $sql = <<EOSQL;
    
    ...
    WHERE   data IN (?)
    
    EOSQL
    
  2. or download this
    my $sql = <<EOSQL;
    
    ...
    WHERE   data IN (@{[join ',', ('?') x $size]})
    
    EOSQL
    
  3. or download this
    my $sql = do {
        my @holders = ('?') x $size;
    ...
    
    EOSQL
    };
    
  4. or download this
    my $sql = sprintf <<EOSQL, join ',', ('?') x $size;
    
    ...
    WHERE   data IN (%s)
    
    EOSQL
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2021-08-04 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (41 votes). Check out past polls.

    Notices?