Ascertain which SQL Query is Presently used by a List

An SQL query is used to define the entries in Lists other than Alarms Lists. To display the SQL query that is presently used by a List:

  1. Display the List in ViewX (see Display a List).
  2. Right-click on the List.
    A context-sensitive menu is displayed.
  3. Select the Edit Query option.
    The SQL query that is used for that particular query is displayed in an SQL window.

    Access to the Edit Query option might be restricted on your system. You will only have access to the Edit Query option if the Geo SCADA Expert server allows SQL queries to be edited from its clients, and your User Account allows you to edit SQL queries. For more information, see Specify Whether SQL Queries can be Edited using the Clients on this Server, and see Define the SQL Editing Settings for a User.

(To display the SQL query that is presently used by a List that is embedded on a Mimic, ensure that the Mimic is being displayed in Design mode (see Displaying a Mimic in the Geo SCADA Expert Guide to Mimics). Double-click on the List to display the Embedded List Properties window, then select the Query tab to view the SQL query that is being used for that List.)

Example:

The Display Points pick action is used to display a List of the points that are associated with a particular DNP3 outstation.

The SQL window is displayed in order to ascertain the SQL query that is being used to display the entries in that particular List.

The SQL window shows that the SQL query returns a series of fields (listed below the SELECT clause) from the Geo SCADA Expert Point Table CDBPoint. The SQL retrieves only those records that pertain to the database item ‘Direct Outstation 1’ within the ‘DNP3 Direct’ Group, which is itself in the ‘DNP3 Group’ (as defined by the WHERE clause). Finally, the returned data is displayed in ascending order (ASC), by full name.

(The Id, Foreground, Blink, and Background fields are ‘special’ fields that are not presented as columns in the List.)

The WHERE Clause is the SQL that is used for the List’s filters—this can also be determined by right-clicking on the List and selecting the Filter option to display the Filter Columns window:

(You can select the Advanced button on the Filter Columns window to show the actual WHERE Clause, and edit that clause if required (see Use SQL to Create a Filter for a List other than an Alarms List).)

The ORDER BY Clause is the SQL that is used to determine the List’s sort order—this can also be determined by right-clicking on the List and selecting the Sort option to display the Sort Order window:

Be aware that if you change the SQL on a List that is not embedded in a Mimic, any changes will be lost as soon as that List is closed.

Further Information

SQL Query Structure in the Geo SCADA Expert Guide to SQL.


Disclaimer

Geo SCADA Expert 2019