RE: Large Delete Problem
Posted in 1997
---------- From: Mohammad Sayeed[SMTP:msayeed@ix.netcom.comcom] Sent: Monday, March 17, 1997 3:26 PM To: informix-list@rmy.emory.edu Subject: Large Delete Problem ....snip... The question: ------------ Does anyone know of a way doing a delete, say, 2000 rows at a time? = Mind the fact the table is not ordered in any way. Thank you. Bappy Babby: Sorry I missed type your name. :-) You said you don't want to drop & recreate the table, why? This is the = most easy and fast way. If you want to have a copy of the table, you = can always unload it to a file before it get deleted. Any way, to answer your question, why don't you just declare a delete = counter. I can only give you some peudocodes as I have not programmed = for a long while: Function Batchdel() { start work: iDel =3D 0; foreach row in the delete cursor=20 delete current; if SQLstatus OK then=20 iDel++; else call errHandler(); endif if (iDel =3D BREAK_POINT) then # BREAK_PONIT =3D 2000 commit work; return endif end foreach } Don't rely on my logic, just try to provide you an idea.