Define the data reader pattern - SmartPlant Foundation - IM Update 46 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

After creating a data reader pattern, you will be navigated to the Define Data Reader Pattern page, where you must do the following:

  1. In the Define Data Reader Pattern page, click Add table from database in the Tables pane.

  2. In the Select Tables dialog box, select the check box beside the name of the table, and click OK.

    In the Select Tables dialog box, you can view the Excel worksheet name and column headers as the table parameters. For example, using the sample file PUMPS_500ORGC.xls you can view the worksheet EqLIst$ as the table.

  3. In the Tables pane, select a table. For example, select EqList in the Tables pane.

  4. In the Table Properties pane, select two or more check boxes beside the column names to include them in the query. For example from the EqList table you can select columns such as Design_Pressure_Max, Design_Pressure_Min, Design_Temp_Max, Design_Temp_MIn,INLETS and Name.

  5. In the Tables pane, select the EqList table.

  6. In the Create Query pane, click Add table to query .

  7. Click Map Selected Fields to map the selected fields to the existing database properties. Name, Description, and Class ID are mapped by default.

    In the Map Selected Fields page, select the business object FDWTag from the Select Mapping Class list and do the following:

    1. In the Selected Fields pane, select a column from the properties to enable the Mapping Field pane

    2. In the Mapping Field : <Property Name> pane, select the Map Type as Property and Property List as Design Data and map the following:

      Selected field

      To property

      Design_Pressure_Max

      Max Design Pressure

      Design_Pressure_MIn

      Min Design Pressure

      Design_Temp_Max

      Max Design Temp

      Select Consolidate option to map it to the FDWTag object.

      Design_Temp_Min

      Min Design Temp

      Select Consolidate option to map it to the FDWTag object.

    3. In the Mapped Fields View pane, click Refresh Mapped Fields View Refresh Mapped Fields View.

      The Mapped Fields View pane displays the UML diagram of the mapped relationship. For example, the UML Diagram displays two SPFN objects:

      • Domain Data object with the mapped properties list.

      • FDWTag object with the list consisting of Name, Description as well as the two properties (Design_Temp_Max, Design_Temp_Min) chosen for consolidation.

  8. Click the Define Data Reader Pattern tab.

  9. Click Generate SQL in the Create Query pane to view the query in the SQL Query pane.

    For example, the SQL Query generated for the selected columns would be:

    SELECT [EqList].[SPFNDData_Max_Design_Pressure],[EqList].[SPFNDData_Min_Design_Pressure],[EqList].[SPFNDData_Max_Design_Temp],[EqList].[INLETS],[EqList].[NAME] FROM ( (SELECT [Design_Pressure_Max] AS SPFNDData_Max_Design_Pressure,[Design_Pressure_Min] AS SPFNDData_Min_Design_Pressure,[Design_Temp_Max] AS SPFNDData_Max_Design_Temp,[INLETS] AS INLETS,[NAME] AS NAME FROM [EqList$] ) AS [EqList] )

  10. Click Save.

  • You can create a WHERE clause in the Table Properties pane for one or more columns to extract only those records that meet a specified criterion as follows:

    1. In the Tables pane, select a table.

    2. In the Table Properties pane, click Create WHERE Clause in the Where column for the appropriate table properties.

    3. In the Generate Where Clause dialog box, select the appropriate option to create a WHERE clause.

    4. Filter by value - Select this option to retrieve records matching a string

    5. Filter by tables - Select this option to retrieve columns matching the criterion

    6. Click OK.

  • In the Tables pane, you can select the table and click Refresh to update the new columns which were added in the database and to remove any columns that no longer exist in the database. The updated or deleted columns are displayed in the Table Properties pane.

  • Click Preview to view the first 100 records that will be extracted by the query as it is defined.