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

PI SQL Commander Lite

Use table and table-valued function templates

  • Last UpdatedFeb 10, 2023
  • 2 minute read

The Element and EventFrame schema in the Master catalog of PI SQL Client each provide a template for the Value table and templates for table-valued functions.

To use a template for creating a view or a table-valued function, do the following:

  1. In the Element or EventFrame schema, expand the Templates folder and then right-click Value or one of the table-valued functions.

    Depending on if you selected to create a view or a table-valued function, you will need to do the following:

    • Click Scripts > CREATE VIEW > New Query Editor Window.

    • Click Scripts > CREATE FUNCTION > New Query Editor Window.

    The template query will be displayed in the Query Editor pane.

  2. In the Query Editor pane, substitute <catalog>, <schema>, and <view> or <function> with their name.

  3. Substitute the parameters with their values.

    Optional parameters are commented with --Optional.

    Blank Value view template

    Value view template with parameters substituted

    Note: TemplateAttributePath and ValueColumnName must always be set. Other column name parameters may be omitted or set to null which removes the columns from the result. If DesiredUOM is omitted or set to null, the default unit of measure is used.

  4. Press F5 to execute the query.

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