order by and top 5 rows

0 views
Skip to first unread message

Paul

unread,
Aug 14, 2009, 4:42:48 AM8/14/09
to Reactor
Hi,

Can anyone pls tell me how i would get this to output the top 5 rows
and in desc order? I have looked through the api and cant even see
where to begin for this. Many thanks.

<cfset scotGateway = beans.reactor.createGateway("scottishStories") />
<cfset Query = scotGateway.createQuery() />

Tom Chiverton

unread,
Aug 14, 2009, 7:00:30 AM8/14/09
to reacto...@googlegroups.com
On Friday 14 Aug 2009, Paul wrote:
> <cfset scotGateway = beans.reactor.createGateway("scottishStories") />
> <cfset Query = scotGateway.createQuery() />

Untested, but:
Query.getorder().setAsc("Dept", "Departments")
Query.setMaxrows(5)
scotGateway.getByQuery(Query)

--

Tom Chiverton
Developer

Tom.Ch...@halliwells.com
3 Hardman Square, Manchester, M3 3EB

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word “partner” to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit
www.Halliwells.com.

Paul

unread,
Aug 14, 2009, 9:23:06 AM8/14/09
to Reactor
Thanks Tom. I'll give it a go

On 14 Aug, 12:00, Tom Chiverton <tom.chiver...@halliwells.com> wrote:
> On Friday 14 Aug 2009, Paul wrote:
>
> > <cfset scotGateway = beans.reactor.createGateway("scottishStories") />
> > <cfset Query = scotGateway.createQuery() />
>
> Untested, but:
> Query.getorder().setAsc("Dept", "Departments")
> Query.setMaxrows(5)
> scotGateway.getByQuery(Query)
>
> --
>
> Tom Chiverton
> Developer
>
> Tom.Chiver...@halliwells.com
> 3 Hardman Square, Manchester, M3 3EB
>
> ****************************************************
>
> This email is sent for and on behalf of Halliwells LLP.
>
> Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners.  We use the word “partner” to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority.
>
> CONFIDENTIALITY
>
> This email is intended only for the use of the addressee named above and may be confidential or legally privileged.  If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents.  If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.
>
> For more information about Halliwells LLP visitwww.halliwells.com.

Rand Thacker

unread,
Aug 14, 2009, 10:59:56 AM8/14/09
to reacto...@googlegroups.com
Just to be clear, you'd use the setDesc() method instead of setAsc() if you were using Descending order...
--
"I am the most humble person in the world!"
Reply all
Reply to author
Forward
0 new messages