{{tag>Index Programmers_Reference Methods IExecutionEngine_Interface executeQuery}} ====executeQuery (IProcess, Query, Integer, Integer)==== public QueryResult executeQuery (IProcessparent, Query query, Integer startRange, Integer span) throws AccessDeniedException, ExecutionException; This method is very similar to the [[pr_methods:executenamedquery|executeNamedQuery]] method except that it runs the provided query instead of the configured query. The provided query does not have to exist in the business space version and may be created by the calling process. ===Parameters=== |''query''|the query to run| |''startRange''|the number identifying the start of the range of the business object instances returned by the query (starting with 1). If all instances are to be returned this parameter must be null.| |''span''|the number of instances of the business objects to return. If all instances are to be returned this parameter must be null.\\ ===Returns=== The instances of the business objects that match the query conditions. These instances are wrapped in the ''QueryResult'' object, which also has the total number of instances in the system matching the query conditions. Note that this number can be greater than the number of business object instances returned by the method as the method may return only a subset of instances matching the conditions (if ''startRange'' and ''span'' are specified).