executeQuery Method

Deprecated  Use IModelDb.withPreparedStatement or IModelDb.query instead.

Execute a query against this IModelDb. The result of the query is returned as an array of JavaScript objects where every array element represents an ECSQL row.

See also:

executeQuery(ecsql: string, bindings?: any[] | object): any[]

throws IModelError If the statement is invalid or IModelDb.maxLimit exceeded when collecting ids.

see IModelDb.withPreparedStatement, IModelDb.query

Parameter Type Description
ecsql string The ECSQL SELECT statement to execute
bindings any[] | object The values to bind to the parameters (if the ECSQL has any).
Pass an array of values if the parameters are positional.
Pass an object of the values keyed on the parameter name for named parameters.
The values in either the array or object must match the respective types of the parameters.
See "iModel.js Types used in ECSQL Parameter Bindings" for details.

Returns - any[]

Returns the query result as an array of the resulting rows or an empty array if the query has returned no rows. See ECSQL row format for details about the format of the returned rows.

Defined in

Last Updated: 13 June, 2024