Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Retrieving multiple records from database

by gmax (Abbot)
on Oct 16, 2004 at 17:39 UTC ( [id://399785]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @ids_to_match = ( ... );
    my $query = "SELECT somedata from table WHERE id IN ("
    ...
    my $sth = $dbh->prepare($query);
    
    $sth->execute(@ids_to_match);
    
  2. or download this
    my $query = "SELECT somedata from table WHERE id IN ("
        . join(",", map { $dbh->quote($_) } @ids_to_match )
    ...
    my $sth = $dbh->prepare($query);
    
    $sth->execute();
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found