Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Interface for Relational Database RDBMS via ODBC

Reading target tag names from the database (distribution)

Reading target tag names from the database (distribution)

  • Last UpdatedAug 19, 2025
  • 2 minute read

If the result rows include columns containing the name of the target tags as well as values, you can define a query that updates those tags. This approach is called distribution.

In this approach, a distributor tag executes the query, which returns the names of target tags and corresponding values, timestamps, and optionally, status. The target tags are updated with the data from the result set. To configure the distributor tag, you specify its query in the InstrumentTag attribute, placeholders in the ExDesc attribute, and set Location3 to -1.

For example, if the database table is composed of the following columns:

Timestamp

TagName

Value

Status

The following query updates the target tag specified in the TagName column:

SELECT timestamp, tagname, value, status FROM
table1 WHERE timestamp > ? ORDER BY timestamp;

If the tag name stored in the RDBMS does not match the name of the target tag in the PI Data Archive, you can map them by specifying the /ALIAS flag in the ExDesc attribute of the target tag. For example, if the result row contains "Tank1" in its "Device" column and you want to store the data from the row in a PI point named "Unit1_Tank1," specify /ALIAS="Tank1". Note that tag name comparisons are not case-sensitive, but aliases are case- sensitive.

Distributor and target tags must be in the same scan class unless you specify an alias (using the /ALIAS parameters), in which case the target tag can be assigned to a scan class different from that of the distributor tag. If the distributor tag is event-based, the scan class (Location4) of all target tags must be set to 0.

After the query is executed, the interface sends two events to the distributor tag:

  • The number of events successfully distributed to target tags

  • The number of rows in the result set

Both entries are timestamped with the current time; that is, both events appear in the archive with the same timestamp.

Note: To refer to tags with points sources other than the one specified for the RDBMS interface instance, use PI ICU to enable the Distribute Outside Point Source option on the rdodbc > Optional Parameters tab.

For information on PI Point naming conventions, see the Tag (PI point name) section in this document.

TitleResults for “How to create a CRG?”Also Available in