This topic contains sections marked as revised for this release

WebSphere Message Brokers
File: ar37670_
Writer: Cerys Giddings

Task topic

This build: July 31, 2007 21:36:48

Deleting data from a database with a mapping node

You can use a DataDelete or a Mapping node to delete data from a database, based on information from an input message, another database or both.

You must do the following before you can delete data from a database using a mapping node:
  1. Create a message flow project
  2. Create a message flow
  3. Define message flow content that includes a DataDelete or a Mapping node
  4. Create a message map file from a DataDelete node or Create a message map file from a Mapping node

You cannot create mappings to delete data from a database by dragging from the source to the target. Instead, you select rows to delete based on the content of the source. You can use an expression to match the content of the source to the target field, for example, use the following instructions to delete all rows in the database that match the content of a field from the input message:

  1. Right-click your DataDelete or Mapping node, and click Open Map. The Message Mapping editor opens with your selected sources and targets.
  2. Select $db:delete in the Spreadsheet pane.
  3. Drag the appropriate source element from the message in the Source pane to the Edit pane. For example, $source/shipTo/accNum.
  4. Drag the appropriate target database field from the Target pane to the Edit pane. For example, $db:delete.SAMPLE.MYSCHEMA.CUSTOMER.CONTACT_ID.
  5. Change the expression in the Edit pane to set the target field to be equal to the source element. For example, $source/shipTo/accNum = $db:delete.SAMPLE.MYSCHEMA.CUSTOMER.CONTACT_ID.
You can use conditional mappings such as If statements to create more complex mappings that define which data to delete from a database. You can also use conditional statements in a Mapping node to perform different database operations depending on the content of the input message. For example, you can add a Table Inserts target, a Table Updates target and a Table Deletes target to a message map, and then use conditional statements to define which of the operations to perform.
Related concepts
Message Mapping editor
Related tasks
Configuring message mappings
Configuring conditional mappings
Related reference
Message mappings
Mapping node
DataDelete node
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:36:49

ar37670_ This topic's URL is: