pf » Undocumented Query Methods in ColdFusion MX

Undocumented Query Methods in ColdFusion MX

coldfusion 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.

3 people found this page useful, what do you think?

Trackback Address: 92/06BA7FD074E7C246B8D61472B97C2069
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




  



Spell Checker by Foundeo





Subscribe to my RSS Feed: solosub RSS
Tags