Thanks. Guess what I was trying to avoid was a loop with 35,000 queries... I was trying to come up wit a clever way to do this in one SQL statement. One issue I noticed is that QoQ does not to seem to (easily?) support joins.
Then again I'm no SQL ninja by any means. S On 31 Jan 2011, at 17:54, Jason Fisher wrote: > > Yes, QoQ will work here. > > > <!--- get your folders ---> > <cfdirectory action="list" name="roomList" type="dir" > directory="#roomsDir#"> > > <!--- get the rooms from the DB ---> > <cfquery datasource="#dsn#" name="roomsDB"> > SELECT roomid > FROM rooms > </cfquery> > > <cfoutput query="roomList"> > <!--- loop through the folders and check against the rooms in the DB > ---> > <cfquery dbtype="query" name="orphanRoom"> > SELECT name > FROM roomsDB > WHERE roomid = '#name#' > </cfquery> > <cfif not orphanRoom.recordCount> > <!--- flag this as a room without a folder ---> > </cfif> > </cfoutput> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341732 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

