Updating a single tag
- Last UpdatedAug 19, 2025
- 1 minute read
- PI System
- Interfaces
The simplest approach is to define a query that retrieves a single value, timestamp and value. For example:
SELECT timestamp, value, status FROM table1…
The timestamp is optional; if omitted, the interface uses the time of query execution. Status is required, and can either be retrieved from the RDBMS or specified as a literal. For example:
SELECT value, 0 FROM table1 …
Result columns must be specified in "timestamp, value, status" order or aliased using the following "PI_" alias keywords: PI_TIMESTAMP, PI_VALUE, PI_STATUS, PI_QUESTIONABLE, PI_ANNOTATION. For example:
SELECT value AS PI_VALUE, status AS PI_STATUS,
timestamp AS PI_TIMESTAMP, annotation AS PI_ANNOTATION, flag AS
PI_QUESTIONABLE FROM table1 …
For details, see
Aliased result columns under Learn about specifying result columns in SELECT statements.
For efficiency, try to issue the minimum number of queries: a single query that returns multiple rows is always more efficient than multiple queries that return one row each.