well, I am actually passing the IDS to a delete-function (which has the ID as parameter) This delete-function has one objectid as a parameter and then does several checks and delete queries in different tables. I simplified it a bit to make my question become more clear.
I also thought that looping over an array was much faster than looping over a list, so I chose the array for performance reasons as it should contain several thousands of records. But maybe somebody just gave me a bad tip ;-) >I'm not sure of the specifics of your tables, but is it possible to >delete it all in one query instead of a loop? Just looking at your >query it seems like the following would be possible: > ><cfoutput>Deleting Orphans...<br/></cfoutput> ><cfflush> ><cfset orphanList = arrayToList(aOrphan)/> ><cfquery name="qDelete" datasource="#variables.dsn#"> >DELETE FROM table >WHERE id IN(#orphanList#) ></cfquery> ><cfoutput>Orphans Deleted.</cfoutput> > >It would certainly save your processing time and server resources. > >HTH, >Jon > >On Mar 6, 2007, at 2:56 PM, b. van kerckhoven wrote: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 by AdobeĀ® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271783 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

