Data Viewer

The Data Viewer enables you to view a Logical Unit database (LUDB), add debugging capabilities and improve testing and defect resolution times.

Since an LUDB is in-memory, it can be viewed by dumping it into an SQLite file which can be shared via email or a common file directory for additional investigations using the Fabric Studio. This file can also be used to execute SQL queries and for analysis. Data Viewer files are saved under the LU VirtualDB_Data directory in: \Fabric\[project name]\Implementation\LogicalUnits\[LU name]\VirtualDB_Data.

Click for more information about Logical Units.

Note that the Data Viewer runs on the Fabric local server. Therefore you must deploy the LU to the Fabric local server before running the Data Viewer on this LU.

Click for more information about deploying LU to the Fabric debug server.

How Do I View Data in a Logical Unit?

image

  1. Go to the Project Tree, click Logical Units and verify that the LU has a green icon, indicating that it is deployed to the debug server. If the LU has a white icon like the test LU in the image above, deploy it to the debug server before running the Data Viewer on it. Do either:

  2. Click drawing next to the selected LU to open the Data Viewer window.

  3. Set the Sync Mode in the top left pane. The default Sync mode is ON.

  4. In the Instance ID field (top central pane) complete the Instance ID or Instance ID by Function fields.

  5. Click image Play to generate a new Data Viewer file. Fabric runs the GET LUI command on the debug server of the selected Instance ID. Each sync of LUI creates a new *.db SQLite file for the LU instance. The LU instance is displayed in the tree.

    Note that if you set the Sync Mode to OFF and the Instance ID does not exist in the debug server, the following error message is displayed:

    Instance '[LU Name]:[Instance ID]' was not found and sync is disabled.

  6. Click the Instance ID to open the Instances Tree dropdown list.

image

  1. Click the Instance DB file to display its tables under the Instance DB tree.

image

  1. Click a table to display its data and then right click the table to open a context menu with the following options:

    a. Show Data, displays the table’s data.

    b. Show Schema, displays the table’s structure.

    c. Show Indexes, displays the table’s indexes, if defined.

Click for more information about Logical Units.

What Are the Data Viewer Components?

The Logical Unit DB Viewer has the following areas:

  • Sync Mode and Instance ID.
  • Instance Tree.
  • Instance DB Tree.
  • Scripting Area.
  • Results Pane and Toolbar.

image

Sync Mode and Instance ID

This area has the following components:

Import DB File image

When clicked, loads and displays an external Data Viewer file.

Sync Mode

Set the Sync Mode for the GET LUI command, initiated by the execution of the Data Viewer. The options are On, Off, and Force. The default mode is On.

Instance ID

To complete this field, do either:

  • Enter a specific Instance ID value.
  • Select a previously stored Instance ID from the dropdown list.
  • Write a function to generate the Instance ID. Note that this function must return a string as an output.

For example:

Instance ID by function: fnCreateInstID (205):

if (i_id!=null && !i_id.isEmpty()){
     return Integer.sum(Integer.valueOf(i_id),10)+"";
   }
return "0";

#### Play image

When clicked, retrieves and saves the data file of the Instance ID for debugging.

Instances Tree

The Instance Tree area (top left) displays a tree of available data files in the following order:

  • LU.
  • Instance.
  • Dated file name.

Instance DB Tree

The Instance DB Tree area (bottom left) displays the Table Tree which includes:

  • k2_lu_object_info, holding statistics per table, population and an Enrichment function.
  • k2_main_info, holding basic information about the LU like LU Name or Instance ID.
  • k2_object_stats, holding object timing statistics.
  • Reference tables under k2_Ref. Note that these are only displayed as part of the Instance DB tree when the reference object is enabled in the LU schema properties.

To display the values of a table in the tree, right click the table and select either:

  • Show Data, to display the table or view it in the Results pane.
  • Show Schema, to display the table structure in the Results pane.
  • Show Indexes, to display the table indexes in the Results pane.

Click for more information about References.

Results Pane and Toolbar

(Bottom right) Displays the data or schema requested with the row count.

Print results.

Export results as an Excel file.

Filter results by one or more columns.

Toggle groupings.

Toggle summaries.

Scripting Area

The SQL scripting area is used to write and run SQL statements on a selected LUDB (upper right pane).

image

The following options are supported:

Run or Run on New Tab

 

  • Click Run to execute the given SQL statement.
  • Click Run on New Tab to open a new Results tab.

Explain query

Description of the strategy or plan that SQLite uses to implement a specific SQL query (e.g. SCAN TABLE)

Dropdown menu of special Run options

  • On current DB file: The SQL is executed on the currently selected instance file.
  • On newest DB file for each instance: The SQL is executed on the newest instance file of each instance in the Instances tree.
  • On selected DB files: The SQL is executed on the selected instance's files. Click and press CTRL to select the required files.
  • On all existing DB files: The SQL is executed on all files in the Instances tree.

Note that when On Newest DB file or On All Existing DB files are selected, the Rows Limit dropdown list opens where you can define the number of results displayed.

Save SQL to File

Saves the current SQL statements to a file.

Load SQL from File

Retrieves an SQL statement from a file previously created in the Scripting area.

How Do I Run an SQL Statement in the Data Viewer?

Run and execute the SQL statement from the scripting area on the selected DB file:

  1. Enter the SQL statement using SQLite syntax into the Scripting area.
  2. Select the DB file to be used to run the statement from the dropdown list.
  3. Do the following:\ a. Click Run or Run on New Tab under the Scripting area.\ b. Press F5 or Ctrl + Enter. Separate multiple queries with ‘;’.
  4. View results in the Results pane.

How Do I Export a Logical Unit Data File?

  1. Go to the Instance DB Tree and right click the DB File.
  2. Click Export Selected DB Files and select the Location and File Name of the exported file.
  3. Save your changes.

Additional (Right Click) DB File Options

  • Open DB opens the Instance DB Tree of the selected DB files.
  • Delete Selected DB Files, deletes the selected Instance DB files from the project folder: Fabric\[project name]\Implementation\LogicalUnits\[LU name]\VirtualDB_Data.

Notes

The latest Data Viewer file can be used in the following components:

Data Viewer

The Data Viewer enables you to view a Logical Unit database (LUDB), add debugging capabilities and improve testing and defect resolution times.

Since an LUDB is in-memory, it can be viewed by dumping it into an SQLite file which can be shared via email or a common file directory for additional investigations using the Fabric Studio. This file can also be used to execute SQL queries and for analysis. Data Viewer files are saved under the LU VirtualDB_Data directory in: \Fabric\[project name]\Implementation\LogicalUnits\[LU name]\VirtualDB_Data.

Click for more information about Logical Units.

Note that the Data Viewer runs on the Fabric local server. Therefore you must deploy the LU to the Fabric local server before running the Data Viewer on this LU.

Click for more information about deploying LU to the Fabric debug server.

How Do I View Data in a Logical Unit?

image

  1. Go to the Project Tree, click Logical Units and verify that the LU has a green icon, indicating that it is deployed to the debug server. If the LU has a white icon like the test LU in the image above, deploy it to the debug server before running the Data Viewer on it. Do either:

  2. Click drawing next to the selected LU to open the Data Viewer window.

  3. Set the Sync Mode in the top left pane. The default Sync mode is ON.

  4. In the Instance ID field (top central pane) complete the Instance ID or Instance ID by Function fields.

  5. Click image Play to generate a new Data Viewer file. Fabric runs the GET LUI command on the debug server of the selected Instance ID. Each sync of LUI creates a new *.db SQLite file for the LU instance. The LU instance is displayed in the tree.

    Note that if you set the Sync Mode to OFF and the Instance ID does not exist in the debug server, the following error message is displayed:

    Instance '[LU Name]:[Instance ID]' was not found and sync is disabled.

  6. Click the Instance ID to open the Instances Tree dropdown list.

image

  1. Click the Instance DB file to display its tables under the Instance DB tree.

image

  1. Click a table to display its data and then right click the table to open a context menu with the following options:

    a. Show Data, displays the table’s data.

    b. Show Schema, displays the table’s structure.

    c. Show Indexes, displays the table’s indexes, if defined.

Click for more information about Logical Units.

What Are the Data Viewer Components?

The Logical Unit DB Viewer has the following areas:

  • Sync Mode and Instance ID.
  • Instance Tree.
  • Instance DB Tree.
  • Scripting Area.
  • Results Pane and Toolbar.

image

Sync Mode and Instance ID

This area has the following components:

Import DB File image

When clicked, loads and displays an external Data Viewer file.

Sync Mode

Set the Sync Mode for the GET LUI command, initiated by the execution of the Data Viewer. The options are On, Off, and Force. The default mode is On.

Instance ID

To complete this field, do either:

  • Enter a specific Instance ID value.
  • Select a previously stored Instance ID from the dropdown list.
  • Write a function to generate the Instance ID. Note that this function must return a string as an output.

For example:

Instance ID by function: fnCreateInstID (205):

if (i_id!=null && !i_id.isEmpty()){
     return Integer.sum(Integer.valueOf(i_id),10)+"";
   }
return "0";

#### Play image

When clicked, retrieves and saves the data file of the Instance ID for debugging.

Instances Tree

The Instance Tree area (top left) displays a tree of available data files in the following order:

  • LU.
  • Instance.
  • Dated file name.

Instance DB Tree

The Instance DB Tree area (bottom left) displays the Table Tree which includes:

  • k2_lu_object_info, holding statistics per table, population and an Enrichment function.
  • k2_main_info, holding basic information about the LU like LU Name or Instance ID.
  • k2_object_stats, holding object timing statistics.
  • Reference tables under k2_Ref. Note that these are only displayed as part of the Instance DB tree when the reference object is enabled in the LU schema properties.

To display the values of a table in the tree, right click the table and select either:

  • Show Data, to display the table or view it in the Results pane.
  • Show Schema, to display the table structure in the Results pane.
  • Show Indexes, to display the table indexes in the Results pane.

Click for more information about References.

Results Pane and Toolbar

(Bottom right) Displays the data or schema requested with the row count.

Print results.

Export results as an Excel file.

Filter results by one or more columns.

Toggle groupings.

Toggle summaries.

Scripting Area

The SQL scripting area is used to write and run SQL statements on a selected LUDB (upper right pane).

image

The following options are supported:

Run or Run on New Tab

 

  • Click Run to execute the given SQL statement.
  • Click Run on New Tab to open a new Results tab.

Explain query

Description of the strategy or plan that SQLite uses to implement a specific SQL query (e.g. SCAN TABLE)

Dropdown menu of special Run options

  • On current DB file: The SQL is executed on the currently selected instance file.
  • On newest DB file for each instance: The SQL is executed on the newest instance file of each instance in the Instances tree.
  • On selected DB files: The SQL is executed on the selected instance's files. Click and press CTRL to select the required files.
  • On all existing DB files: The SQL is executed on all files in the Instances tree.

Note that when On Newest DB file or On All Existing DB files are selected, the Rows Limit dropdown list opens where you can define the number of results displayed.

Save SQL to File

Saves the current SQL statements to a file.

Load SQL from File

Retrieves an SQL statement from a file previously created in the Scripting area.

How Do I Run an SQL Statement in the Data Viewer?

Run and execute the SQL statement from the scripting area on the selected DB file:

  1. Enter the SQL statement using SQLite syntax into the Scripting area.
  2. Select the DB file to be used to run the statement from the dropdown list.
  3. Do the following:\ a. Click Run or Run on New Tab under the Scripting area.\ b. Press F5 or Ctrl + Enter. Separate multiple queries with ‘;’.
  4. View results in the Results pane.

How Do I Export a Logical Unit Data File?

  1. Go to the Instance DB Tree and right click the DB File.
  2. Click Export Selected DB Files and select the Location and File Name of the exported file.
  3. Save your changes.

Additional (Right Click) DB File Options

  • Open DB opens the Instance DB Tree of the selected DB files.
  • Delete Selected DB Files, deletes the selected Instance DB files from the project folder: Fabric\[project name]\Implementation\LogicalUnits\[LU name]\VirtualDB_Data.

Notes

The latest Data Viewer file can be used in the following components: