QueryColumnExists
This function returns true if the column exists in the query
Method Signature
QueryColumnExists(query=[query], column=[string])
Arguments
Argument
Type
Required
Description
Default
query
query
true
The query to check for the column
column
string
true
The column to check for
Examples
ID column is in given query
myQuery = queryNew( "ID,name,age" );
writeOutput( queryColumnExists( myQuery, "ID" ) );
Result: true
Whereas "gender" is not
myQuery = queryNew( "ID,name,age" );
writeOutput( queryColumnExists( myQuery, "gender" ) );
Result: false
Additional Examples
myQuery = queryNew( "custID,custName" );
writeDump( queryColumnExists( myQuery, "age" ) );
writeDump( queryColumnExists( myQuery, "custName" ) );
Related
Last updated
Was this helpful?