Working with the SQL panel

EXAMPLE

Query the original value and original time stamp of the data point elements ExampleDP_Arg1 and ExampleDP_Arg2 (both of data point type ExampleDP_Float) using the SQL panel. Of course, you can also use other data points you have created yourself for this example.

Solution:

  1. Open the SQL panel from the System management panel: System Management > Reports > SQL Query
  2. On the Select tab select "_original.._value" and "_original.._stime" from the Configuration combo box and click or to add them to the list of SELECT statements.
    Figure 1. Elements of the SELECT statement
  3. On the From tab use the data point selector to select the data points to query (here "ExampleDP_Arg1" and ExampleDP_Arg2") and click or to add them to the list of FROM statements.
    Figure 2. Elements of the FROM statement
  4. Now press Create query to build the query which is displayed in the bottom line of the SQL panel (see below). This displays the data tab.
    Figure 3. Query statements
  5. On the Data tab click Start query to trigger the database query.
    Figure 4. Database query
  6. The query and the data returned from the database are displayed on the Data tab. The first column lists the statements in the FROM statement ("ExampleDP_Arg1" and "ExampleDP_Arg2") and the remaining columns display the values returned by the SELECT statement (here "_original.._value" and "_original.._stime").