tracker issue : CF-3037081

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 74368:(Watson Migration Closure)CFQuery should be updated with the following new optional attributes:

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)

Created: 12/17/2008

Components: Database, CFQuery

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 6

Problem:

CFQuery should be updated with the following new optional attributes:

page (numeric)
recordsPerPage (numeric, defaults to 10 when page is provided alone)

<cfquery name="currentPage" page="#url.page#" recordsPerPage="#x#" >
    select * from table
</cfquery>

The indexes of the first and last returned, and the total number of applicable records for a query that uses pagination should be available as properties of the query object (similar to recordCount), named as follows:

Ex: Viewing #currentPage.firstRecord# - #currentPage.lastRecord# of #currentPage.totalRecords# total search results.

Benefits: Improves application performance by implementing paginating at the data level instead of the application level and returning only the portion of the recordset that’s needed. Simplifies and improves pagination (next n interface) code. Provides an RDMS-agnostic, portable syntax for common functionality.

Sidenote: While it’s on stage, the maxRows attribute should be deprecated and maxRecords should replace it. It’s inconsistent and hampering to have a property called recordCount and an attribute called maxRows. (Or recordCount could be deprecated in favor of rowCount, in which case recordsPerPage would be rowsPerPage, firstRecord firstRow, etc.)
Method:


Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3037081

External Customer Info:
External Company:  
External Customer Name: David McGuigan
External Customer Email: 5E0D54C04462BF5E992016B6
External Test Config: 12/17/2008

Attachments:

Comments:

+1 vote. Just to reproduce a post I made on the forums regarding this: [quote] [QUOTE Adam Cameron] OK, but I don't think when we're talking about paging the recordset we're intrinsically talking about facilitating a tabular display with << prev 10 next 10 >>. In fact it hadn't even occurred to me that it could be used for that sort of thing. My reason for wanting to grab only n records at once is that I just don't want to grab the whole lot in one hit because that's going to be very heavy on data throughput, RAM usage, and not necessarily a good use of clock cycles. Think of it as analogous to the difference between <cffile action="read"> (the whole file) and fileRead(myFile, buf) (just a sensible amount to work with, thanks). [/QUOTE] Actually [url=http://java.sun.com/javase/6/docs/api/javax/sql/rowset/JdbcRowSet.html]this[/url] is the sort of thing I was thinking about. [quote] 1.0 Overview [...] Because a JdbcRowSet is a connected rowset, that is, it continually maintains its connection to a database using a JDBC technology-enabled driver, [it] can simply take calls invoked on it and in turn call them on its ResultSet object. As a consequence, [...] it can be used to make a ResultSet object scrollable and updatable. All RowSet objects are by default scrollable and updatable. If the driver and database being used do not support scrolling and/or updating of result sets, an application can populate a JdbcRowSet object with the data of a ResultSet object and then operate on the JdbcRowSet object as if it were the ResultSet object. [/quote] And it seems [url=http://media.datadirect.com/download/docs/connectsqlxml/jdbcug/jdbcref.htm]DataDirect drivers support[/url] such an enterprise, on a lot of their drivers. And for the ones that don't they degrade gracefully. I'm well out of my depth assessing the doability of this, but it [i]sounds[/i] like it shouldn't be too tricky... [/quote]
Vote by External U.
24382 | November 10, 2011 07:09:01 PM GMT
Note: queryName.totalPages should be added as a 4th property available in a query object that utilizes pagination.
Vote by External U.
24383 | November 10, 2011 07:09:03 PM GMT
This bug has been voted..
Vote by External U.
24384 | November 10, 2011 07:09:05 PM GMT
This is one of those features that to me is exactly what CF is about and that is making developers more productive.
Vote by External U.
24385 | November 10, 2011 07:09:06 PM GMT
As long as CF can control the data on the db side, I'm all for this. It would rock to have this. Talk about making life easier.
Vote by External U.
24386 | November 10, 2011 07:09:07 PM GMT
+1! This would totally make life easier!
Vote by External U.
24387 | November 10, 2011 07:09:09 PM GMT