Can you give me an example of how to return rows 10 to 20 via mssql?  If so, I might add this to the framework.

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Baz
Sent: Friday, February 10, 2006 1:39 PM
To: [email protected]
Subject: RE: Reactor For CF query.setMaxRows()

 

 

> given that each RDBMS may have a different keyword for limiting the number of returned results, it might be difficult to work this into Reactor.

 

A big role of Reactor is to generate db-specific output from consistent input. My feeling is that Reactor is perfectly suited to handle such a job.  And I know you can fake MySQL’s LIMIT functionality in MS-SQL (I’m sure in other DBs as well). There could be a new method called Search() for gateway objects, that accepts arguments like:

 - StartRow

 - MaxRows

 - Keywords

 - sortByFieldList

 

And have it return a struct that includes:

 - SearchResult.Query (the actual query result of your search)

 - SearchResult.TotalRows (total rows of query had you not limited it thru MaxRows)

 

You could build a nice pagination tag that just takes the SearchResult struct.

 

Baz

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Seth Petry-Johnson
Sent: Friday, February 10, 2006 1:12 PM
To: [email protected]
Subject: Re: Reactor For CF query.setMaxRows()

 

I meant to add this to my last post:  given that each RDBMS may have a different keyword for limiting the number of returned results, it might be difficult to work this into Reactor. 

On 2/10/06, Seth Petry-Johnson <[EMAIL PROTECTED]> wrote:

Is MySql's LIMIT similar to MS SQL's TOP keyword?

 

i.e. select top 5 blahID, blahName from someTable order by blahID to return 5 rows with the lowest IDs?

 

On 2/10/06, Michael Lantz <[EMAIL PROTECTED] > wrote:

I have to agree that some sort of functionality like that would be great for
pagination, and, short of writing your own query and bypassing Reactor, I
don't see how this could be done within the framework as it now stands.

I do believe that LIMIT/OFFSET is mysql specific, though...

Michael

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Chris
Blackwell
Sent: Friday, February 10, 2006 11:07 AM
To: [email protected]
Subject: Reactor For CF query.setMaxRows()

>From looking at the query debug output it looks like setMaxRows() function
sets the maxrows attribute of the <cfquery> tag, as I don't see LIMIT in the
sql.

When displaying large paginated recordsets i like to use the power of
MySQL's LIMIT clause and provide an offset so I only get back the rows I
will be displaying, like...

SELECT * FROM tblName
LIMIT 10 OFFSET 20

I don't know whether this works in other DB's.

So is there anyway to implement this in Reactor?  Seems to me that the query
object would need a setOffset() method, but that might break in dbs other
than mysql.

If this is "application functionality that is needed by the developer that
may seem, to the developer, like it should be a job of the framework itself"
then feel free to shoot me down ;)  At the moment I'm still trying to get my
head around Reactor so working out where it should end and my application
starts is a little blurry atm.

Chris

 

 

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

Reply via email to