pf » Undocumented Query Methods in ColdFusion MX
August 20, 2002
Undocumented Query Methods in ColdFusion MX
I found some undocumented methods that you can perform on a query by using Java Reflection. The methods are summarized here:
void query.first() - jump to the beginning of a query void query.last() - jump to the last value in a query boolean query.isFirst() - true if we are looking at the first row boolean query.isLast() - true if we are looking at the last row boolean query.next() - jump to the next row boolean query.previous() - jump to the previous row int findColumn(String name) - get the id of a column by name void sort(int columnId, boolean ascending) - sort by a column int getColumnCount() - returns the number of columns String getColumnTypeName(int columnId) - gets the data type of a column, this one didn't work properly when I tested it, it would return NUMERIC for a field that was a varchar. There is a method called guessColumnType that was probably used to determine it, it guessed wrong.
I have put together a web site called ColdFusion MX Un-Documentation that has some examples of how to use these features.
Trackback Address: 92/06BA7FD074E7C246B8D61472B97C2069
Comments
On 04/02/2004 at 11:08:20 AM MST Rich Zaide wrote:
1
has the sort() method been disabled/removed in 6.1? Appears so...
Got the following:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code
On 02/07/2005 at 7:30:28 AM MST barry.b wrote:
2
(a blast from the past) well CF7 has just been released and these "features" are *still* undocumented!
which is a shame because all they do is provide the same sort of functionality that I used to use with ASP/ADO six years ago!
CFQUERY is CF's weakest link. with feature rich asp.net there's some catching up to do...
my 2c barry.b
- Mastering CFQUERYPARAM
- Google Code Search for ColdFusion
- Speaking at CFUNITED 2008
- Getting ColdFusion SQL Statements from SQL Server Trace
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
Subscribe to my RSS Feed:
RSS
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in











