The Query Object
This topic is divided into the following sections:

For more general information on data access and how it is handled with eSuite applets, refer to the "eSuite and Data Access" topic.

Overview of the Query Object

The Query object is used with the queries property of the JdbcSource applet to specify an SQL statement to be executed. The Query object can be used to execute both retrieval queries which return results and non-retrieval queries which don't return results. There can be multiple query objects for a given JdbcSource applet.

The output of the Query object is a VectorDataSet which is published to the InfoBus using the Query object's name as the data item name. The outgoing data item is a data item from which the query results can be read.

The Query object uses the name of the query to identify InfoBus data items for its respective query information. For example, if your Query name is "emp", the following data items are generated:

Data Item Name Type Description
emp.resultStyle Incoming Sets the result style for the data results of the retrieval query.
emp.trigger Incoming Causes "emp" query to be executed when set to true.
emp Outgoing Contains the results for the "emp" retrieval query or the number of rows affected for the "emp" command query or -1 if not applicable.
emp.status Outgoing Contains the status of the "emp" query: "OK", "no data" or an error message.

Query Object Properties

The following properties are available for programming the Query object via JavaScript:

AutoExecute property
IsRetrieval property
Name property
ResultStyle property
SQL property