Specifying a schematic diagram template query is often required when that template is based on the Standard builder and used to build diagrams through custom queries. In the following example, suppose the objects stored in the database belong to different gas plants; a particular field in the database identifies each object per gas plant. It would be interesting to use this information to define a specific diagram template that would filter out the objects related to a given gas plant. Then, for each gas plant, you could generate a diagram. To define such a diagram template, you need to configure the query related to this template and the way each diagram identifier will be built. The steps below detail how to configure these parameters:
- Edit your schematic dataset within Schematic Dataset Editor.
- If the schematic dataset resources are not arranged in a tree view in the Schematic Items window, click Views on the Schematic Dataset Editor toolbar and click Project Tree.
- Click the desired schematic diagram template from the Schematic Dataset Editor tree.
- Click the Properties tab.
- Click the Query/Identifier button .
The Query/Identifier Editor dialog box opens:
- From the Data Source list (1), click the desired data source.
All the data sources referenced in the schematic dataset are available in the drop-down list.
- From the Tables list (2), click the table on which the query is going to operate.
The selected table's content is automatically displayed in area 3.
- In the Queryarea (4), type your query SQL code.
- Click Show Results (5).
The query results are displayed in the Results area (6):
- From the Fields list (7) where all the fields returned by the specified query are displayed, click the field that will be used to build the identifier for each diagram item and use the Move Right button (8) to validate.
The chosen field name is automatically displayed in the Identifier list (9):
- Click OK to validate and stop the diagram template query and identifier definition.
The SQL code is automatically reported in the Query area field from which Query/Identifier Editor has been opened.