IsQuery

Determine whether the given value is a BoxLang Query object.

Method Signature

IsQuery(value=[any])

Arguments

Argument
Type
Required
Description
Default

value

any

true

Value to test for query-ness.

Examples

Create and populate a query and output the 'name' column as a list if it is a valid query

Run Example

names = queryNew( "name", "varchar" );
queryAddRow( names );
querySetCell( names, "name", "Seth" );
queryAddRow( names );
querySetCell( names, "name", "Jen" );
if( isQuery( names ) ) {
	writeOutput( queryColumnData( names, "name" ).toList() );
}

Additional Examples

Run Example

testVar = "Hello World";
// Returns false as it is not a query.
dump( IsQuery( testVar ) );
testQuery = QueryNew( "col1" );
// Returns true as it is a query.
dump( IsQuery( testQuery ) );

Last updated

Was this helpful?