Search code examples
coldfusioncfloop

CFML - query row to structure


I would like to handle a row from a query by a function, where I pass the row as a structure.

ideally...

<cfloop query="myquery">
 #myfunction(#row#)#
</cfloop>

I could set it up like this too...

<cfloop query="myquery">
 #myfunction(#col1#,#col2#,#col3#,#col4#)#
</cfloop>

but I don't want to. I haven't been able to finda simple way of extracting a row, But I thought I'd ask.


Solution

  • Adobe ColdFusion 11 introduced QueryGetRow which converts a row from a query into a struct.