Mariusz wrote:

> I would like to be able to select records from the a table where record_id
> and $record_id from my @record_ids matches. I know I could go through a
> loop and send a SELECT query for each element in the array but is there a
> better way? How can I accomplish the same but only sending one query?
> 
> thanks,
> Mariusz

i don't really understand your question. are you saying that currently you 
are doing something like:

foreach my $record_id (@record_ids){
        my $sql = "select * from your_table where record_id = $record_id";
        #-- send $sql to DB
}

you don't like it because you end up sending multiple SQL to your DB and you 
would like a way to just send one SQL? If so, try something like:

my $sql = 'select * from your_table where record_id in('
. join(',',@record_ids) . ')';

#-- send $sql to DB

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to