Create an Extra Table Query
To create an extra table query:
- Access the ClearSCADA Server Configuration Tool (see Accessing the ClearSCADA Server Configuration Tool)
- Expand the Database Configuration branch.
- Select the Extra Table Query branch to display the Extra Table Query section.
- Right-click on the background of the Extra Table Query section to display a context sensitive menu.
- Select the Add Query option.
A new Query is added to the list. - Double-click on the query to display the Table Query window.
- Use the Table Query window to define the settings for the new Query:
- Use the Index spin-box to select the index number for the new query. The index is a number that is associated with the query.
When you create a new query, ClearSCADA allocates the next available index number automatically. Usually, the allocated number is suitable. However, you may need to define a specific number if you are creating queries on a system that is to be merged with another system—you will need to define an index number that is not in use on either system.
ATTENTION: If you change the Index number, the data that is associated with that Index number is lost.
- Use the Table combo box to select the table to which the query will be applied. For more information on the various tables, see Working with the Database Schema in the ClearSCADA Guide to the Database.
- In the Name field, enter the name of the pick action option. The name that you enter will be shown on the pick action menu for the items in the relevant table. For example, if you add a query to the CDBPoint table and define its name as Display Current Day, a Display Current Day option added to the pick action menus for database points.
The name that you define should be relevant to the query and should indicate what data is displayed when the option is selected.
- In the Title field, enter the title for the Query window. When the pick action is selected, the Query will be displayed in a new window—the title of the new window matches the entry you make in the Title field.
- In the Query field, enter the SQL query that provides the data for the list.
- Use the Index spin-box to select the index number for the new query. The index is a number that is associated with the query.
- Select the OK button to confirm the query settings and close the Table Query window.
- Repeat steps 4-7 inclusive for each query that you want to add.
When you close the ClearSCADA Server Configuration Tool, you will be prompted to restart the ClearSCADA server (see Restart the ClearSCADA Server). When the server is restarted, the new settings will take effect.
NOTE: You can use the $ trip character in the Title, and Query fields. The $ trip character instructs the system to insert the relevant value for the defined field. For example, if you set the Title to 'Hourly Value for $FullName$', and then displayed the query list for a point named 'Input 1', the Title of the Query window would be 'Hourly Value for Input 1'.