In an SQL SELECT statement you can use a column alias to assign a specific name to a column. Normally if you use a scalar expression in an SQL SELECT statement, the column name is blank. The alias feature is useful to set a specific column name. For example:
SELECT ROUND( Value, 4 ) AS "Value" FROM TagDataPointAnalog
Certain column aliases, beginning with the number sign (#) character, have a special meaning when used with the SQL Test Tool. These column aliases turn on features such as row color, row blink or row menu. The column alias values that have special meaning include:
Alias | Description |
---|---|
#RowColor | The column value is converted to an integer, and the value defines the row color |
#RowBlink | The column value is converted to a boolean value, and the value defines whether the row blinks or not |
#RowMenu | The column value is converted to a string, and the value defines the context menu associated with the row |
To see examples of how these column alias values are used, browse the standard SQL queries:
To use the #RowMenu column alias, you need to construct a column alias using the correct syntax. Two types of row menu are supported:
The Standard Tag Menu provides access to the features of a tag. The standard tag menu is defined by a string using this syntax:
Tag:full-tag-name [ | menu-options]
Where:
For more information on these parameters see Standard Tag Menu Parameters.
To obtain a string in this format use the following SQL expression in a select list:
'Tag:'||FullName AS "#RowMenu"
Note: The || operator concatenates the string 'Tag:' with the full name. This should result in a tag menu string with the correct format.
The standard alarm menu provides these options:
The standard alarm menu is defined by a string using this syntax:
Alarm:source-name,condition-name,active-time,cookie
To obtain a string in this format use the following SQL expression in a select list:
'Alarm:'||SourceName||','||ConditionName||','||Cast(ActiveTime as VARCHAR)||','||Cast(Cookie AS VARCHAR) AS "#RowMenu"
To learn about the SQL Test Tool in Fernhill SCADA.
Fernhill SCADA Structured Query Language (SQL)
To learn about the structured query language (SQL) supported by Fernhill SCADA.
For the meaning of terms used in Fernhill SCADA.