Specifying schematic diagram template query and identifier using Schematics Query/Identifier Editor
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.
Note:Double-clicking the desired table in the Tables list automatically fills the Queryarea (4) with a default query that returns all the records in that table.
- 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):
Note:- Several field names can be specified to build diagram identifiers. In that case, each identifier is obtained by concatenating all the fields in their entry sequence order—that is, in the Identifier list order. The concatenated fields are hyphenated. To modify the field sequence, click the field you want to move to another location from the Identifier list and either click the Move Up or Move Down arrow at the right of the Identifiers section until the list is ordered as desired.
- String constants can also be configured to build diagram identifiers. Use the Add Identifier button at the right of the Identifier section to add such a string in your identifiers; it will be concatenated with the other specified fields.
-
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.