Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
nameanalysis
nopaneltrue

By the end of this chapter you will be able to:

  • Set up a database exporter

In this exercise you will create an export of the customer summary report, to a database table:

  1. In your model, to add a new database exporter, hover over the stream table Customer Summary by Region, and press 
    Insert excerpt
    _database_exporter
    _database_exporter
    nopaneltrue
    .
  2. Give the new exporter the Name: Customer Summary By Region
  3. Press 
    Insert excerpt
    _finish
    _finish
    nopaneltrue
    .
  4. You will now see the new database exporter in the model.
  5. Save your model layout.

To complete the configuration of the database exporter:

  1. Tick the flag Enabled
  2. Select the Datasource to Rating and Billing
  3. Go to the Statement Expression field and enter the query:

    Code Block
    insert into DEST_CUST_SUMM_BY_REGION
     (REGION, TOTAL_LAST_BILL_AMT, AVG_LAST_BILL_AMT)
     Values
     ({Region}, {TotalLastBillAmount}, {AvgLastBillAmount})


  4. Press 

    Insert excerpt
    _finish
    _finish
    nopaneltrue
    .

    Note that the pipe to the database exporter is dotted – this means that it is a Push pipe. When linking a table to a database exporter you must always use a push pipe. This is because you cannot run a database exporter on its own; it must always be driven from a table (otherwise, it has no data to process).

    To test the database exporter you will run Customer Summary by Region. This is because the pipe you created to the database exporter is a push pipe, and so by running this stream you will push data from the stream to the exporter.

  5. Run analysis on the table Customer Summary by Region.
  6. Open the 
    Insert excerpt
    _console
    _console
    nopaneltrue
    .
  7. Your job will be at the top of the list in the Completed Tasks section - to see messages, double click this.
  8. Check the log messages for this job – in particular scroll to the end; you should see messages telling you that data has been exported by your database exporter.

Reviewing your exported data

You can review the data you have just exported using the PhixFlow schema browser:

  1. Hover over the icon for the database exporter Customer Summary By Region
  2. In the toolbar press 
    Insert excerpt
    _table_show_outputs
    _table_show_outputs
    nopaneltrue
    .
  3. The Datasource Rating and Billing will appear on your model view.
  4. Hover over the icon for the datasource Rating and Billing.
  5. In the popup press 
    Insert excerpt
    _table_show
    _table_show
    nopaneltrue
    .
  6. Find the table you exported to - DEST_CUST_SUMM_BY_REGION
  7. Double-click on the table to bring up the table data - this is the data you just exported.