Chad... can't attach files to the list, but I'm sending you a CF Routine
that does exactly that... coming shortly. 


Robert B. Harrison
Director of Interactive Services
Austin & Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be &.

Plug in to our blog: A&W Unplugged
http://www.austin-williams.com/unplugged



-----Original Message-----
From: Chad Gray [mailto:[email protected]] 
Sent: Tuesday, January 12, 2010 12:55 PM
To: cf-talk
Subject: reorder a query


I am thinking there has to be an easier way to do this then what I currently
have.

I need to move a row in a Query object up or down.  Like imagine a page with
little arrows on each record and you want record 2 to move to the position
of record 1 and move record one to the position of record 2.

Then I want to delete the records from the table and insert the newly
ordered records back into the database.

The direction I am currently going is to loop over the query object find the
records that needs moved and start creating an Array for the new order
2,1,3,4 etc.

Then use QueryAddColumn(getColors, "reOrder", "integer", reOrderArray) to
insert the array into my query object.

Then user a Query of a Query to do a 
SELECT *
FROM getColors
ORDER BY reorder

Then delete the records and loop over the query object to insert back into
the table.

Seems really overly complicated...  Can anyone think of a better way?




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329576
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to