Top  | Previous | Next

Expression/SQL Properties

DBTags have the ability to use an expression or a SQL query as their value instead of an OPC item path. This can be used to select information from the database or create your own formulas to manipulate other tag values .

Expression

In expression mode, the tag can use all of the features available in the expression language. It can refer to other tags, and use operators and functions to calculate a value for the tag.

 

See also:

Expressions Overview

SQL Query

In this mode, the tag's value will be the result of the specified SQL query. The query can be any valid query, but should result in only one value. Note that insert and update queries can be used, and will often result in an integer value, so the tag's data type should be set accordingly.

 

Like SQL Query bindings in the Vision module, the queries for tags can refer to other tag values. The values of referenced tags will inserted as literal text in the query before being sent to the database.