Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 surveying the Monastery: (2)
As of 2021-10-23 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (88 votes). Check out past polls.

    Notices?