Adding a database mapping output

Before you start:

Before you use any mappings that you create, ensure that any databases that you have defined are registered with ODBC correctly on your computer.

There are two ways to add a database mapping output (target) from the Resource Navigator view, depending on whether you are adding the database to the workspace for the first time or if the database has been imported previously and is already in the workspace.

If you cannot import the database definition, ask your database administrator to export the schema files for you to use.

Importing database schema files using the Data perspective

You can also import database schema files using the Data Perspective.

  1. Use the Data perspective to connect to the database.
  2. In the DB Servers view of the Data perspective, expand that database connection that you have created to display the database table.
  3. Right-click the database table and select Import to folder.
  4. Provide the name of a folder that exists in the message flow project.
  5. Return to the Broker Application Development perspective and reopen the mapping file in the Message Flow Mapping editor.
  6. Right-click anywhere in the white space of the Target pane and select Add RDB Table Mapping Input from the pop-up menu.
  7. Select the radio button entitled Add database table schemas from workspace and select the appropriate table from the list.

Database table names

By default in mappings, database table names are identified by the broker default schema and are in the format:
Database.table_name
However, if you define a schema for your application and define tables within the schema, you must prefix the table names with the schema name to produce the following format:
Database.schema_name.table_name
To do this:
  1. Right-click the database table in the Target pane and select Set RDB Schema Name from the pop-up menu.
  2. Select one of the three options:
    • Use default runtime schema for this data source produces the format:
      Database.table_name
    • Use schema name in table definition produces the format:
      Database.schema_name.table_name
      where schema name is obtained from the RDB table xmi file.
    • Use name specified produces the format:
      Database.user_specified_schema_name.table_name
  3. Click OK to save your changes.

Defining the schema name for an individual table, as described above, overrides the global definition in the Preferences dialog (see Defining the schema name).

Note: Do not rename the .tblxmi file, or you will need to re-map everything.
Related reference
Mappings