Configuring a DatabaseInput node

Create and configure message flows that respond to events in a database.

Before you begin

Check which databases are supported on which platform, and if any restrictions apply:

Ensure that your database is configured to record events (uses an event table), and that you know how to query those events.

z/OS platformIf you use IBM DB2® on z/OS®, your user ID (or your user group) requires permission to perform a SELECT on SYSIBM.SYSJAROBJECTS.

Complete the following tasks:
  • Add a database definition to the IBM Integration Toolkit.

About this task

When you drag a DatabaseInput node onto the canvas, IBM Integration Bus creates an ESQL module that contains boilerplate text. To configure the DatabaseInput node, modify the statements in that module to suit your requirements.

When you double-click the node to modify the ESQL code, the editor displays the Database Event Design tab for the module. Complete the mandatory fields and then click Generate query. To view or modify the code, click the Source tab. Code that has been generated is clearly marked by color-coded --@!{ and --@!} comments. Any changes that you make within these comments are lost if you regenerate the code.

Procedure

  1. In the IBM Integration Toolkit, drag a DatabaseInput node onto the canvas, and double-click the node.
    The Database Event Design tab is displayed. Ensure that the correct module is selected.
  2. Complete the Event Table section.
    1. Optional: Complete the Database schema property.
      Leave it blank to use the default runtime schema.
    2. Complete the Table property.
      This property represents the database table used as your event store.
    3. Complete the Primary key property.
      This property represents the primary key of the database table used as the event store.
    4. Complete the Foreign key to application table property.
      This property represents the column in the event table that references the row in the application table containing the changed data to be processed by the DatabaseInput node. This is typically the primary key of the application table.
    5. Optional: Complete the Status column property.
      This property represents the name of a column, if you update a column in the event table to indicate that the event has been processed. Leave blank if you delete events from the event table after processing.
    6. Optional: Complete the New event status value property.
      This property represents the value written to the status column when the event is first added. Enclose character values in single quotation marks, for example 'Y'. Enter numbers without quotation marks. For a null value, enter NULL. Check the trigger setting in your database for appropriate values.
    7. Optional: Complete the Processed event status value property.
      This property represents the value written to the status column after the event has been processed. Enclose character values in single quotation marks, for example 'Y'. Enter numbers without quotation marks. For a null value, enter NULL. Check the trigger setting in your database for appropriate values.
  3. Complete the Application Table section.
    1. Complete the Table property.
      This property represents the table that includes the changed data to be processed by the DatabaseInput node.
    2. Complete the Primary key property.
      This property represents the primary key of the database table used as the application table.
    3. Complete the Output message element property.
      This property represents the output message that will be propagated to the flow.
  4. Click Generate query.
  5. Optional: Click the Source tab to view the code, or add customized code.
  6. On the Basic tab of the DatabaseInput node, specify the data source. This data source is the ODBC data source name of the database that contains the tables that you refer to in the ESQL module.
  7. On the Basic tab, ensure that the ESQL module property refers to the correct module.
  8. Optionally, change values on the other tabs of the node.
  9. Configure the rest of the flow to use the message from this node.

What to do next

Configure your target system to receive the message.

Changing the default color of auto-generated text

Procedure

  1. Click Window > Preferences.
  2. In the tree on the left, navigate to Integration Development > ESQL > ESQL Editor.
  3. On the Colors tab, select Auto-generated, and select the color.