Exercise: Making PI OLEDB Provider Queries - Writes

Document created by kduffy on Sep 26, 2018Last modified by kduffy on Jul 2, 2019
Version 13Show Document
  • View in full screen mode

Object: The goal of this exercise is to practice the generation of PI OLEDB provider queries. Whether the application is using PI OLEDB Provider directly or using it through the PI ODBC Driver or PI JDBC Driver, the queries themselves are the same.



Use the following resources:

As well as these additional resources:


Problem Statement:

Reactors in a monitored plant have sensor values written to the PI Data Archive via an OSIsoft interface, however the current operating zone of the reactor has not been written to PI. The history of these zones for these reactors is, however, stored in a SQL database, and operations would like to get this backfilled into the PI Data Archive. The PI admins would like for the SQL application to create the tags and import the data history.


For each step of the following scenario, produce a PI OLEDB Provider query that performs the requested action:

1. Confirm that the following tag does not exist: "ReactorOpZone"

2. Create a digital state set called OperatingZones that contain the following five values: "Free", "Load", "Reaction", "Unload", "Clean"

3. Create the digital tag from step 1, pointing it to this new digital state set

4. Backfill the data by writing the following values:


11/1/18 10:00Free
11/1/18 14:00Load
11/1/18 14:30Reaction
11/4/18 04:00Unload
11/4/18 04:20Clean
11/4/18 06:00Free
11/4/18 09:00Load
11/4/18 10:00Reaction


5. Query this time range and confirm that the values were input correctly

6. It's been decided that "Free" should be changed to "Empty", so the digital state needs to be changed.

7. Execute the query in step 5 again; does anything need to be changed?


Have questions? Ask the community

When you are ready, compare your answers with the Solution: Making PI OLEDB Provider Queries - Writes