Dan,

Thanks for the response.

I believe that the format needs to be setAsc("tablename","column1","column2")

The problem is that this query joins 2 tables and I want to sort first on a column in table 1 then on a column in table 2. Maybe it's not possible to do with reactor unless you go with a custom object.

Ray

On 9/18/06, Dan Vega <[EMAIL PROTECTED]> wrote:
Ray,
I believe that you need to provide a comma seperated list

setAsc("dept,departments,advisor,name")


On 9/18/06, Ray Buechler < [EMAIL PROTECTED]> wrote:
Couldn't find an answer to this in the archives and cannot believe I haven't run into it already in my own use of reactor.

How do you sort more than one column in a Reactor query?

Here is my code:

<!--- Create Advisors Gateway --->
<cfset AdvisorXMLGateway = Application.Reactor.CreateGateway("Advisor") />

<!--- Create the query --->
<cfset AdvisorXMLQuery = AdvisorXMLGateway.createQuery() />
<cfset AdvisorXMLQuery.join ("Advisor","Dept","deptXML") />
<cfset order = AdvisorXMLQuery.getorder().setAsc("Dept","Departments")>
<cfset AdvisorXMLGateway.createquery().setorder(order)>

<cfset qAdvisorXML = AdvisorXMLGateway.getByQuery(AdvisorXMLQuery) />

As you can see the query joins 2 tables. The other column I want to sort is from the other table.

I tried this <cfset order = AdvisorXMLQuery.getorder().setAsc("Dept","Departments","Advisor","name")> and while it didn't result in an error it also didn't sort the the name column.

Has anyone figured out how to do this?

Thanks,

Ray

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --




-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to