Run SQL Update through an ETL Chain

Introduction:

This entry guides you through the steps on how to run a direct SQL Update query using the ETL Step “JDBC SQL Updater”.

The example in this entry reads the values to be updated from a XLSX file and use those values as parameters to be parsed into the update query. Values could also be hardcoded into the update query if required.


Prerequisites:

1/ To establish a connection to your database table, feel free to refer to the following entries below as a guide:

2/ Do refer to the following entry here as a guide on how to create an ETL chain that reads an external XLSX file:

In this example, we are using the following XLSX data to update the pre-created “Persons” database table:

PersonID DOB LastName FirstName Email
1 21/4/1958 White Johnson johnson@example.com

3/ This example uses the “Persons” database table which has the following set of records with PersonID as its Primary Key.


Steps:

  1. In the same chainset created based on “Prerequisite - Point 2”, create another chain.
    For example, ‘04 - SQLUpdater’

  2. Add the following steps into the newly created chain in Step 2:
    “Chain Call”, “JDBC Definition”, “JDBC SQL Updater”
    image

  3. In the step “Chain Call”, in the dropdown field select the chain that reads the external XLSX file.
    image

  • You may wish to add more than 1 “Chain Call” step if the values you require is from different files.
  1. In the step “JDBC Definition”, select the Database connection and create the SQL update query based on your requirements.
  • The example above updates the email column value based on the PersonID column value.
  1. Save the ETL Chain and click on the play button to run the Chain.