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 the
pane.In the right pane, click the
icon to update the pane.Use the
tab to define the basic parameters of the query.Under
, do one of the following.To automatically generate the query source code, click the
radio button.The source code is then not editable in the
tab.To enter a custom query where the query source code is editable, click the
radio button.The source code is editable in the
tab, 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 in
text area.Use a comma to separate database table names.
Drag and drop the database tables and columns directly from the
paneClick (
) 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 the
text area or click ( ) to open an edit dialog box for more space to enter the Where clause:If defining a custom query, switch to the
tab 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 following
radio 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 the
tab 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 the
tab at the bottom of the pane to run a quick sampling from a database table.