Getting Started with InfoSphere Data Architect
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 8 – Model Mapping and Discovery 153<br />
it to target element. You create constant mappings by right-clicking a target element in the<br />
Mapping Group Details view, then selecting Create Constant Mapping from the menu.<br />
• Mapping groups: Mapping groups sort mapped elements by the target table (in a relational<br />
database) or by the element (in an XML schema). When you generate scripts for these mapping<br />
groups, one query is generated per mapping group.<br />
• Invalid mappings: The mapping becomes invalid when you change the properties of data<br />
objects in the source or target model. When the mapping editor is opened, all of the mappings<br />
are re-validated. If the source or target object is no longer valid, then the mapping is invalidated<br />
and a red “X” will appear on the mapping line.<br />
8.4 Adding expressions and filters to the mapping model<br />
You can create transformation statements for each mapping that is created. The expression may be a<br />
filter, join, sort, or a transform function on a source column to get the desired target column value. The<br />
expression may change either the value or data type of the source column to be compatible <strong>with</strong> the<br />
target column. These expressions are SQL fragments and appear in the DDL that you generate from the<br />
mapping model.<br />
Let's create a mapping transformation expression to make sure that all of the rows in the<br />
STUDENT.FIRST_NAME column of the NEW_SDT_INFO_SYS.dbm physical data model appear in<br />
uppercase when they are consolidated <strong>with</strong> the information in the STUDENT_INFO_SYSTEM.dbm<br />
physical data model.<br />
To create a transformation expression:<br />
1. Select the mapping line between the two STUDENT.FIRST_NAME columns. The properties of<br />
the mapping appear in the Properties view.<br />
2. Click the Expression Builder button next to the Transformation field. The Expression Builder<br />
window opens.<br />
3. Select a function. In this case, you will add a function to make sure that all first names stored in<br />
the database are stored in uppercase characters. Expand the String node and select the<br />
UCASE(VARCHAR) – VARCHAR function.<br />
The function appears in the Transformation expression pane.<br />
4. Place the cursor between the parentheses, as shown in Figure 8.10.