Undocumented Query Methods in ColdFusion MX
August 21, 2002
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.
Tweet
Trackbacks
Trackback Address: 92/06BA7FD074E7C246B8D61472B97C2069
Comments
On 04/02/2004 at 1:08:20 PM EST 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 9:30:28 AM EST 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
On 07/28/2009 at 11:20:38 AM EDT dickbob wrote:
3
This sounds really useful! Is it still applicable for CF8/9? I looked at your linked examples but couldn't find anything that explained how to implement the idea. Do you have a simple, self-contained, example you can share/blog?
TIA
Post a Comment
Recent Entries
- Nginx redirect www to non www domain
- HashDOS and ColdFusion
- HackMyCF Updated for APSB11-29 Security Hotfix
- Adobe eSeminar on FuseGuard
- Determining Which Cumulative Hotfixes are Installed on ColdFusion
- Adding Two Factor Authentication to ColdFusion Administrator
- ColdFusion Developer Week at Adobe.com
- Bug Loading Scripts for CFFileUpload and CFMediaPlayer


add to del.icio.us



