Use the Graphical Data Mapping editor to insert data into
a database table.
Before you start:
You must complete
the following task:
Create a graphical data map by using
the Graphical Data Mapping editor. For information, see Creating a message map.
To insert a row, or multiple rows, into a database table
by using the Graphical Data Mapping editor, complete the following
steps:
With a graphical data map (.map) file
open in the Graphical Data Mapping editor, right-click the canvas,
and select Database > Insert
into table. Alternatively, select a schema
element as an input object, and then click the Insert a
row into a database table icon. The Insert wizard
is displayed.
In the Schema field, select the
database schema that you want to use to build the transform. To use a different database schema at run
time, you can override this value by setting the databaseSchemaNames property
of the JDBCProvider configurable service that connects to your database;
see Setting up a JDBC provider for type 4 connections.
In the Table field, select the table
that you want to modify.
Optional: Select Treat warning as
error. If this option is selected, the first
SQL operation that results in a warning from the selected database
raises an exception.
Important: Database warnings are
vendor-specific. For more information about database warnings, see
the documentation for your database product.
Click OK. An Insert transform
and a Return transform are created as a transform
group, and are displayed in your graphical data map. The Return transform
is an optional transform type. If you do not need to use the Return transform,
you can delete it from your graphical data map.
Optional: To replace a Return transform
that you deleted from your graphical data map, right-click your Insert transform
and select Database > Utilize
return.
In the Graphical Data Mapping editor, connect input objects
to the Insert transform to define the content
of your inserted row.
Connect a non-repeating element to the Insert transform
to insert a single row into the selected database table.
Connect one or more repeating elements to the Insert transform
to insert multiple rows into the selected database table. To connect
multiple repeating elements, select your repeating elements, then
right-click the Insert transform and select Create
Connection.
If you connect a single repeating element, the Insert transform
is nested inside a For Each transform. If you
connect multiple repeating elements, the Insert transform
is nested inside a Join transform. In either
case, the nested transform opens so you can continue to edit your Insert transform.
Click the Insert transform to create
connections to the columns in your inserted row, and to further define
the transform.
Optional: Connect the Return transform
to implement a nested mapping that is called if the Insert operation
was completed successfully.
Optional: Click the Return transform
to further define the transform. A nested map is
created, in which you can select the specific transforms that are
required for the input and output elements.
Next:
If you want exceptions that are returned from the database server
when the SQL operation is run to be handled by the map, instead of
having such exceptions stop the map and being reported, you can add
a Failure transform into the transform group; see Handling database exceptions in a graphical data map.