This exercise teaches you how to transform a source element to
be compatible with a target element.
To add a transformation to an element in the mapping model:
- Right-click on the mapping line between /SAMPLE/SAMP/DEPARTMENT/DEPTNO
and /SAMPLE/SAMP/PROJECT/DEPTNO/DEPTNO in the mapping editor.
These
elements seem to be a perfect match. You can verify this by selecting Properties
from the drop-down menu. The properties page contains useful information about
the source column and the target column. In this example, the DEPTNO data
type is CHAR in both the source and the target.
But, to ensure that
all of the department numbers have lower case characters, add a lower case
function to the element.
- Right-click on the mapping line between /SAMPLE/SAMP/DEPARTMENT/DEPTNO
and /SAMPLE/SAMP/PROJECT/DEPTNO/DEPTNO, and select to open the Expression Builder wizard.
- In the Functions field, expand the String
functions, and double-click the LCASE(VARCHAR) function. The
LCASE function appears in the Transformation expression field as LCASE().
- Click in the parenthesis of the function to change the focus, then
double-click on the DEPTNO element in the Columns field.
The DEPTNO column appears in the parenthesis.
- Click OK.
The mapping
line changes to show that a transformation has been added.
- From the menu bar, click or CTRL+S to save the results of
the current mapping between /SAMPLE/SAMP/DEPARTMENT/DEPTNO and /SAMPLE/SAMP/PROJECT/DEPTNO/DEPTNO.
You now have a saved mapping model that you can use to deploy SQL
statements to a server.