Mapping Table Descriptors to Table Instances
A Program or other executable object instance can read data only when its source Table Descriptors are mapped to the Table instances that contain the source data, and can write data to Table instances only when target Table Descriptors are mapped to the Table instances.
In addition, both the executable instance and the Table instance must be installed in the database. Table Descriptors must be mapped to Table instances at both the Table and Column level.
Mapping Columns: When you map a Table Descriptor to a Table instance, the system may or may not be able to map Columns automatically. If not, you can map them manually; see Mapping Table Descriptors Manually.
However, if a Target Table Descriptor in a Load Set or Program is updated or new columns added, installation automatically upgrades the Table instance and completes the mapping. Note that the Table instance is upgraded only if the changes to the Table Descriptor are non-destructive, such as the addition of a column.
You can supply default values for any Columns that are still unmapped; see Mapping Columns to Constants. In some cases, you can map columns of different data types and lengths; see Mapping Columns of Different Data Types and Lengths).
For source Table Descriptors you do not need to map Table instance Columns that are not used by the Program.
Data Processing Compatibility: Be sure to map target Table Descriptors to Table instances whose data processing type is compatible with your source code:
- If you have insert, update, and delete statements in your source code, you must map your target Table Descriptors to Table instances with a data processing type of either Transactional or Staging.
- If you have insert statements only, you must map your target Table Descriptors to Table instances with a data processing type of either Reload or Staging.
This section includes the following topics:
- Automatic Mapping by Name
The Automatic Mapping by Name job can run on multiple Table Descriptors in a Program or other executable object. By default, it looks for a Table instance with the same name in the same Work Area as the executable instance. - Mapping Table Descriptors Manually
If you want to map a Table Descriptor to a Table instance that has a different name, you must map it manually. You can also use this method to remap a Table Descriptor that is already mapped. - Remapping
You can remap a mapped Table Descriptor to a different Table instance in two ways. - The Effects of Modifying the Table Descriptor or Table Instance on a Mapping
A mapping is specific to a particular version of both the Table Descriptor and the Table instance.
Parent topic: Defining and Mapping Table Descriptors