Simon Baynes: Web Development

Undocumented Query Methods

As a die hard cfscript fan I often find myself frustrated that I cannot use all of ColdFusion's functionality from within a cfscript block. Happily has several functions that let you get around these.

There are also some very helpful undocumented Java methods that you can use with queries in ColdFusion.

    // get your query from a function
    qGetMyQuery = myFunction();

    // this method sets the query's position to zero. ie before the first member

   // now we are going to use a while loop to go loop through the query
   while ( {

       writeOutput(qGetMyQuery.columnName[qGetMyQuery.currentRow] & "<br />");

Please bear in mind that these are undocumented techniques and so should be tested if used when you upgrade ColdFusion.

By Simon Baynes