On 21-Jun-01 Chris Petersen wrote:
> Why not do something like:
>
> my $q = "DELETE FROM master WHERE master_id NOT IN (";
> $q .= join(',', @masteridarray);
> $q .= ')';
> $dbi_dbh->do($q);
>
> Though this will obviously fall into the same size limitations that you were
> doing, but it should execute a lot faster, and be a bit smaller than your
> example. (I don't have an answer for this, being rather new to the mysql
> community myself).
>
here, @ids is the array, delete in chunks of 64:
while ( my(@id)= splice(@ids,0,64)) {
$qry="DELETE FROM master WHERE master_id in (".join(',',@id).")";
SQLQuery($qry);
}
Adjust '64' as needed..
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php