Handling database exceptions in a graphical data map

Add a Failure transform to your graphical data map to handle exceptions that might be raised as a result of a database transform.

About this task

If you want the map to handle exceptions that are returned from the database server when the SQL operation is run, instead of such exceptions stopping the map and being reported, you can add a Failure transform to the transform group. The Failure transform is an optional transform in each of the database transform groups, and can be added or removed as required. If an exception is raised by the configured database server, and you have not configured a corresponding Failure transform, the map operation is stopped.

To add a Failure transform to a graphical data map by using the Graphical Data Mapping editor, complete the following steps:

Procedure

  1. With a graphical data map (.map) file open in the Graphical Data Mapping editor, right-click a Select, Insert, Update, Delete, or Database Routine transform, and then select Database > Handle Failure.
    A Failure transform is created, and is displayed in your graphical data map.
  2. Connect the Failure transform to specify how any exceptions from the database transform are processed when the map is run. If the Failure transform is present in the graphical data map, and is connected to one or more output objects, then the exception is caught and processed by the Failure transform. Database transforms additionally have a Treat warnings as exceptions option.
    • Important: If the Failure transform is present in the graphical data map, but is not connected, then the exception is caught by the Failure transform, and is ignored.
    • If the Failure transform has been deleted from the graphical data map, then the exception is handled by the Mapping node in your message flow, and is handled in the same way as other message flow exceptions.
  3. Click the Failure transform to open the nested map and further define the transform.

Results

You have added and configured a Failure transform into your graphical data map. If you want the failure to cause the execution of the map to stop when the database transform receives an SQL exception, remove the Failure from the transform.