Re: Delete Only 50 rows from table
Posted in 2005
jayloub wrote: > I need to delete a limited number of rows from the table. > The table contains 50,000. > > I only want to delete the records older than a certain date and then > only 500 at a time. Why such small batches? Why not provide bigger logical logs? It's much the easiest way to deal with it. Which language do you want to use? In ESQL/C etc, you can do it with a cursor 'WITH HOLD' and 'FOR UPDATE' and simply collect 500 rows, delete each row WHERE CURRENT OF cursor, and then COMMIT. In pure SQL, you are probably stuck with minor variants on the solution Savio Pinto suggested - nasty and slow, but effective nonetheless. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/