The first step is to define the basic query that instructs the adapter to pull information from a specific database table or set of tables.
HINT:To retrieve data and seed the adapter upon startup or restart, define an initial query that runs once, then define a second query to retrieve new data or changes after the initial query. Otherwise, the adapter definition reads the entire database every time the adapter is started or restarted, potentially causing performance issues.
To define a query:
Select an element or alarm in thepane.
In the right pane, click theicon to update the pane.
Use thetab to define the basic parameters of the query.
Under, do one of the following.
To automatically generate the query source code, click theradio button.
The source code is then not editable in thetab.
To enter a custom query where the query source code is editable, click theradio button.
The source code is editable in thetab, but the and text areas are not editable in the tab.
Do any of the following to specify the database tables:
Enter the database tables intext area.
Use a comma to separate database table names.
Drag and drop the database tables and columns directly from thepane
Click () to open an edit dialog box for additional typing space.
Depending on the Query Type, do one of the following:
In the Editor tab, enter a Where clause in thetext area or click ( ) to open an edit dialog box for more space to enter the Where clause:
If defining a custom query, switch to thetab to edit the source code directly.
If no lock mode is set in the Data Integrator Query (for example, select * from table WITH (ROWLOCK) when using SQL Server), the select statements use the default locking strategy for the database.
To determine whether to remove all alarms that are not found in a query, select one of the followingradio buttons:
Use Adapter Property: Select to use the current value for the adapter property. For more information, see Section 4.4, Specifying Run-Time Adapter Properties.
Yes: Select to remove all alarms not listed in the subsequent query.
No: Select to keep all alarms regardless of the query results.
Switch to thetab to define how each property value is extracted from the database using the query.
For instructions on defining properties, see Section 6.2, Defining Element or Alarm Properties.
Use thetab at the bottom of the pane to run a quick sampling from a database table.