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:

  • In your model, add a new Database Exporterdatabase exporter:
    • Hover over the stream Customer Summary by Region, and press Image Removed press Image Added - Add a new Database Exporter
    • Give the new exporter the Name: Customer Summary By Region
    • Press 

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

...

database exporter:

  • Tick the flag Enabled
  • Select the Datasource to Rating and Billing
  • Go to the Query String tab, and Statement Expression field 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})
  • Press 

    Note that the pipe to the

    Database Exporter

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

    Stream

    stream to a

    Database Exporter

    database exporter you must always use a

    Push

    push pipe. This is because you cannot run a

    Database Exporter

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

    Stream

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

    To test the

    Database Exporter

    database exporter you will run the

    Stream

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

    Database Exporter

    database exporter is a

    Push

    push pipe, and so by running this

    Stream

    stream you will push data from the

    Stream

    stream to the exporter.

  • Run Analysis analysis on the Stream Customer Summary by Region
  • Open the console - Image Added
  • Your job will be at the top of the list in the Completed Tasks section - to see messages, double click this
  • Check the log messages generated in the Console for this job – in particular scroll to the end; you should see messages telling you that data has been exported by your Database Exporter

 

...

  • database exporter

Reviewing your exported data

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

  • Hover over the icon for the Database Exporter database exporter Customer Summary By Region
  • In the tool bar press - Show Outputs
  • The Datasource Rating and Billing will appear on your model view
  • Hover over the icon for the Datasource datasource Rating and Billing
  • In the toolbar, press  - Show Tables
  • Find the table you exported to - DEST_CUST_SUMM_BY_REGION
  • Double-click on the table to bring up the table data - this is the data you just exported