Versions Compared

Key

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

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

  • Set up a Database Exporterdatabase 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

...

  1. database exporter, hover over the stream Customer Summary by Region, and

...

  1. press Image Added Add a new Database Exporter
  2. Give the new exporter the Name: Customer Summary By Region

...

  1. Press Image Added

You will now see the new Database Exporter on the modelling panedatabase exporter in the model.
Save your model layout.
To complete configuration of the Database Exporter:

...

database exporter:

  1. Tick the flag Enabled
  2. Select the Datasource to Rating and Billing
  3. Go to the

...

  1. Statement Expression field enter the query:

    Code Block
    insert into DEST_CUST_SUMM_BY_REGION

...

  1. 
     (REGION, TOTAL_LAST_BILL_AMT, AVG_LAST_BILL_AMT)

...

  1. 
     Values

...

  1. 
     ({Region}, {TotalLastBillAmount}, {AvgLastBillAmount})

...


  1. Press Image Added

    Note that the pipe to the

...

  1. database exporter is dotted – this means that it is a Push pipe. When linking a

...

  1. stream to a

...

  1. database exporter you must always use a

...

  1. push pipe. This is because you cannot run a

...

  1. database exporter on its own; it must always be driven from a

...

  1. stream (otherwise, it has no data to process).

    To test the

...

  1. database exporter you will run the

...

  1. stream Customer Summary by Region. This is because the pipe you created to the

...

  1. database exporter is a

...

  1. push pipe, and so by running this

...

  1. stream you will push data from the

...

  1. stream to the exporter.

  2. Run

...

  1. analysis on the Stream Customer Summary by Region
  2. Open the Image Added Console
  3. Your job will be at the top of the list in the Completed Tasks section - to see messages, double click this
  4. Check the log messages

...

  1. for this job – in particular scroll to the end; you should see messages telling you that data has been exported by your

...

  1. 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

...

  1. database exporter Customer Summary By Region
  2. In the tool bar press Image Modified

...

  1. Show Outputs
  2. The Datasource Rating and Billing will appear on your model view
  3. Hover over the icon for the

...

  1. datasource Rating and Billing
  2. In the toolbar,

...

  1. press Image Modified

...

  1. Show Tables
  2. Find the table you exported to - DEST_CUST_SUMM_BY_REGION
  3. Double-click on the table to bring up the table data - this is the data you just exported