Re: any size limitation as to the size of a query statement?

2001-06-21 Thread Chris Petersen
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

Re: Re: any size limitation as to the size of a query statement?

2001-06-21 Thread Bill Marrs
My code generates a large query. I had to increase the size of max_allowed_packet so that this query would work. I have this in my /etc/my.cnf file: set-variable = max_allowed_packet=2097152 -bill - Before posting, please

Re: any size limitation as to the size of a query statement?

2001-06-21 Thread Don Read
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

RE: any size limitation as to the size of a query statement?

2001-06-21 Thread Mark A. Sharkey
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

Re: any size limitation as to the size of a query statement?

2001-06-21 Thread Chris Petersen
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); } I thought about this, too.. But Mark said that he needed to delete from the table where the ID's don't match. If you

Re: any size limitation as to the size of a query statement?

2001-06-21 Thread Don Read
On 21-Jun-01 Chris Petersen wrote: 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); } I thought about this, too.. But Mark said that he needed to delete from the