Skip to main content Skip to complementary content

Inserting the employee data into a MySQL table using SCD

Configure the first tFixedFlowInput component and the first tMysqlSCD component to insert the employee data into a MySQL database table using SCD (Slowly Changing Dimensions).

Procedure

  1. Double-click the first tFixedFlowInput component to open its Basic settings view.
  2. Click the button next to Edit schema and in the pop-up window define the schema by adding five columns: id and age of Integer type, name and role of String type, and salary of Double type.
    When done, click OK to save the changes. In the pop-up dialog box, click Yes to propagate the schema to the next component.
  3. In the Mode area, select Use Inline Content (delimited file). Then in the Content field displayed, enter the following input employee data.
    1;Mark Smith;30;tester;11000.00
    2;Thomas Johnson;32;developer;12000.00
    3;Teddy Brown;33;tester;13000.00
    
  4. Click the first tMysqlSCD component to open its Basic settings view.
  5. Select the Use an existing connection check box and from the Component List drop-down list displayed, select the connection component you have configured.
  6. In the Table field, enter the name of employee_scd.
  7. Click the button next to SCD Editor to open the SCD editor. All schema columns are listed on the Unused panel.
  8. In the name field on the Surrogate keys panel, enter the name for the surrogate key, SK in this example.
  9. From the Unused panel, drag and drop
    • id to the Source keys panel to use it as the key to ensure the unicity of the input data,

    • name to the Type 0 fields panel and no special action will be performed upon dimension changes of it,

    • age to the Type 1 fields panel to perform Type 1 SCD on it,

    • role to the Type 2 fields panel to perform Type 2 SCD on it, and

    • salary to the Type 3 fields panel to perform Type 3 SCD on it.

  10. In the Versioning panel, select the version check box to hold the version numbers for the historical and current records in the SCD table, and select also the active check box to add the column that will hold the True value for the current active record or the False value for the historical records in the SCD table.
    When done, click OK to save the changes and close the SCD editor.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!