ColdFusioning.com
Pronunciation \kold-fy-zhn-ing\ Noun: The actions of one that writes ColdFusion.

Please check out my new site: http://ja.mesbrown.com/

QueryDeleteRows UDF in CFLib

Oddly enough, ColdFusion doesn't have a QueryDeleteRows function. Luckily for us, Ray Camden has come up with a UDF to help us. If you view the UDF in CFLib you can plug that UDF into your code and then just issue a

view plain print about
1<cfset x = "1" />
2<cfset Query = QueryDeleteRows(Query,x) />

and it will remove your row. You can even list multiple rows (e.g. "1,3,5"). This function is especially helpful with Fusebox because I had pre-existing to create a drop-down menu and I didn't need a row.

Thanks Ray!

TweetBacks

Comments

You can also use the underlying Java to remove query rows and it will save you from looping through the query.

Query.removeRows(JavaCast("int",startRow-1),JavaCast( "int", Rows ));

You have to subtract 1 from the ColdFusion Query row index, because the Java row numbering starts at 0.

# Posted By Dominic O'Connor | 4/6/09 11:55 AM

Recent Comments

RSS

Subscribe