Dan, that won’t work, setAsc() requires two arguments, the ObjectAlias
and the FieldAlias
Each call to setAsc() appends a new node to the query, so you simply
need two calls to setAsc(),
<cfset AdvisorXMLQuery.getorder().setAsc("Dept", "Departments")>
<cfset AdvisorXMLQuery.getorder().setAsc("Advisor", "name")>
Cheers, Chris
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Vega
Sent: 18 September 2006 16:17
To: [email protected]
Subject: Re: [Reactor for CF]
Order By
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|