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

Run Example

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

Result: true

Whereas "gender" is not

Run Example

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

Result: false

Additional Examples

Run Example

myQuery = queryNew( "custID,custName" );
writeDump( queryColumnExists( myQuery, "age" ) );
writeDump( queryColumnExists( myQuery, "custName" ) );

Last updated

Was this helpful?