Configure the Query Properties
Use the fields on the Query tab to define the request for data transfer, how often that request is sent to the other application, and the connection used to access that application:
- In Service—Use to specify whether the ODBC Query is active or inactive (see Placing an Item In Service in the ClearSCADA Guide to Core Configuration).
- Confirm Disable/Enable—Users with the required permission can disable a query that is in In Service, or enable a query that is not In Service.
Use the Confirm Disable/Enable combo box to specify whether a confirmation dialog box is displayed whenever an operator requests that this connection is disabled or enabled (see Requesting Confirmation of Action Requests in the ClearSCADA Guide to Core Configuration).
- Severity—Use to define the severity of any alarms or events that are associated with the ODBC Query (see Defining Severities in the ClearSCADA Guide to Core Configuration).
- Area of Interest—This field is only displayed if the Area of Interest feature is enabled on your system. Use the field to specify the Area of Interest with which any non-state related point alarms or events are to be associated (see Assign a Different Area of Interest to an Item's Alarms and Events in the ClearSCADA Guide to Core Configuration).
NOTE: Use the Area of Interest field to specify the area with which any ODBC Query alarms or events are to be associated (see Assign a Different Area of Interest to an Item’s Alarms and Events in the ClearSCADA Guide to Core Configuration).
- Connection—Use to specify the ODBC Connection that determines to which application this Query is sent. Use the browse button to display a Reference browse window and select the required Connection from the window.
- Scan Rate—Specify the frequency with which this data request is sent to the other application. Enter the rate in the OPC Time Format, for example 30S for a 30-second scan rate. You can enter the value directly in the field, or use the Interval Window (accessed via the field’s browse button) to specify the required rate.
- Query—Enter the SQL code that defines the data transfer mechanism that is required (for instance, which block of data is to be retrieved from the other database).
For an example of SQL query code, see Data Retrieval Examples. Full guidance on using SQL is outside the scope of this guide. We advise that any SQL Queries are written by engineers who have the appropriate experience and knowledge of the SQL language.
NOTE: If you later take the Query out of service, its dependants (points) also become out of service. This does not affect the configuration of these items.
Each Query is executed on system or driver start-up, and thereafter at the specified Scan Rate interval, or whenever a Refresh is requested (for example, by an operator selecting the Refresh pick action for a Query).
Whenever a Query is executed, the data that is sent to ClearSCADA as a result of that query is stored in a results table, internally within the ODBC driver. You then use ODBC points (see Points Used for ODBC Data Transfer) to extract particular data values from that table.