Thanks, Don.  However, this is sort of the opposite of what we need.  We
need to delete from master where master_id  NOT IN the array.  If we do that
in chunks, after the first chunk, we would have wiped out all of the records
outside the array.

It seems like with Chris's suggestion, along with Bill's suggestion about
the max_allowed_packet setting, we should be okay.  However, if there are
still more ideas out there, I'd love to hear them!

Mark



> -----Original Message-----
> From: Don Read [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 21, 2001 8:46 AM
> To: Chris Petersen
> Cc: [EMAIL PROTECTED]; Mark A. Sharkey
> Subject: Re: any size limitation as to the size of a query statement?
>
>
>
> 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

Reply via email to