queryColumnExists

Checks whether a column exists in the given query object

queryColumnExists(query, column) → returns boolean

Member Function Syntax

query.columnExists(column)

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

Argument Reference

query query
Required

column string
Required

Examples
Sample code invoking the queryColumnExists function

myQuery = queryNew("ID,name,age");
writeOutput(queryColumnExists(myQuery,"ID"));

Expected Result: true

myQuery = queryNew("ID,name,age");
writeOutput(queryColumnExists(myQuery,"gender"));

Expected Result: false

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub