One of the most helpful tools for building queries against the different PI SQL query engines (RTQP, PI OLEDB Provider, PI OLEDB Enterprise) is the collection of sample queries.
Within PI SQL Commander, the Query Compendium provides a few sample sql files with numerous queries organized by topic, as well as sample queries for each table. The documentation contains the query compendium for the PI OLEDB Provider and PI OLEDB Enterprise as well.
PI SQL Commander - Query Compendium
- In PI SQL Commander, click on the "Query Compendium" button along the top toolbar
- Navigate through the folders to access the different .sql sample files. Double click on the one of interest.
- Read through the file in the query window and highlight the query you would like to execute
- Click the "Execute" button to run this specific example query
Note: PI OLEDB Provider and PI OLEDB Enterprise each have a single set of query files, but RTQP has two:
- The first set is in the "Migration" folder and are intended to mimic the PI OLEDB Enterprise query compendium layout, converting the PI OLEDB Enterprise queries to equivalent RTQP queries.
- The second set is in the "Queries" folder and is intended to be a standalone query compendium guiding you through the RTQP Engine without the context of PI OLEDB Enterprise.
PI SQL Commander - Predefined Queries:
Each table in PI SQL Commander has a predefined query that can be executed against it to demonstrate usage and syntax.
- Navigate to the table of interest in the Object Explorer
- Right click on the table and select "Execute Predefined Query..."