Sample Session

In this session, you:

  1. · Execute referential integrity method

Creating Referential Integrity Classes

In this exercise you will import referential integrity classes:

  1. In Data Builder, open the Work with Data Elements window (click or access it through Environment > Work with Data Elements).
    Note: You can also access the Work with Data Elements window from the main window by selecting the file name, right-clicking to view the context menu, and then by clicking Work with Data Elements of the Selected Data Store.
  2. From the Select Data Elements tab, click the Apply Filter button to display all data stores.
    Note: To narrow down the list of data elements displayed, use the filter fields (Machine ID, Company name, and Application ID), and then click Apply Filter. To display all data elements, simply click Apply Filter.
  3. Click the Classes - Assignment tab.
  4. Click Import Class.
  5. Select the Referential Integrity import type:
  6. In the Machine ID list, specify ALLIE.
  7. In the Company list, specify DXPROJ.
  8. In the Database list, specify GSDEMO.
  9. Click Show Schemas.
  10. Click Import.
  11. Close the Import Class window.

    In the All Classes pane in the Work with Data Elements window, classes CLA0201 and CLA0202 now exist in the None Super Class.

  12. In the List of Data Store Data Elements, notice:
    • class CLA0201 is assigned to CUSTOMER.C_NO and ORDERS.C_NO
    • · class CLA0202 is assigned to ORDERS.O_NO and ITEMS.O_NO
  13. Close the Work with Elements window.
  14. If you are planning to go straight on to the next tutorial Data Subset Extraction using a Combined Data Element, you can keep Data Builder open. Otherwise, either Click File > Exit or click the button, and then click Yes.
  15. Continue to the next section.

Creating a Referential Integrity Method

Create a referential integrity method:

  1. In Data Subset Extraction, open the Import Method window by clicking (Import Method from Referential Integrity).
  2. Enter the following details for the method:
    Machine ID ALLIE
    Company DXPROJ
    Group DX40GS
    Method (method name) RI METHOD
    Method text (method description) RI METHOD
    Class CLA0201
    Database GSDEMO
  3. Click Import.
  4. Click Properties.
  5. Click Active to activate the method.
  6. Click OK to close the Method Properties window.
  7. Click OK to close the Work with Method window.
  8. Continue to the next section.

Exporting Referential Integrity Method Information to Extension Technology

Export your referential integrity method information.

  1. Click (Distributed Exporter) from the main window of Data Subset Extraction.
  2. Verify that the method RI METHOD is selected.
  3. Click Export.
  4. When prompted to continue elaboration, click Yes.
  5. Click OK.
  6. Click Close to close the Distributed Exporter window.
  7. If you are planning to go straight on to the next tutorial Data Subset Extraction using a Combined Data Element, you can keep Data Subset Extraction open. Otherwise, either Click File > Exit or click the button, and then click Yes.
  8. Continue to the next section.

Executing Referential Integrity Method

By default, the Extension Technology will attempt to insert the processed data into the target database. For testing purposes, it is possible to configure the Extension to instead write the processed data into text files as comma separated values (.csv).

Execute subset extraction with Extension Technology:

  1. From a MS-DOS prompt, change to the executables directory c:\Program Files\Micro Focus\Data Express 4.0\odbc.
  2. 2. Type dxestart
    The target ODBC data store now contains the table TGT.CUSTOMER, TGT. ORDERS, and TGT.ITEMS. The contents within these tables follow the referential integrity defined in the database:
    • Only records in the TGT.ORDERS table that have the same customer number as records in the TGT.CUSTOMER table are present.
    • Likewise, only records in the TGT.ITEMS table that have the same order number as records in the TGT.ORDERS table are present.
  3. Continue to the next section.

Verifying Results

Verify that the tables are in fact different.

  1. Launch the SQL Wizard:
     ..\mfsql\bin\xwiz40n 
    		
  2. Notice that the tables TGT.ORDERS and TGT.ITEMS have been reduced.