Step 3 Define an SQL Where condition and input parameter

LANSA Composer

Step 3. Define an SQL Where condition and input parameter

LIC007 - Extract Database to CSV File

This transformation map needs to support the selection of employees by department code to be inserted into the CSV text file. In this step you will complete the transformation map by adding an SQL Where Condition, and an input parameter linking the file PSLMST to the output text file via the SQL Where Condition.

1.  Insert an SQL Where Condition using the Insert / SQL-WHERE Condition menu option.

2.  Link the PSLMST file to the table element of the SQL-Where, this will open the SQL-Where properties dialog:

3.  Define the selection as DEPTMENT = :Department_In (note the colon - and lack of space - before Department_In). This will define an input parameter – see example below.

     Note: DEPTMENT is the name of the department code field in the file PSLMST, which the transformation is reading.

4.  Click the OK button to save these changes. Your map window should now look like the following:

5.  Using the Function / Insert Input menu option to define an Input parameter.

6.  Define a string input called Department_In  and click OK.

     Note: You can also define a default value and use this in Mapforce to produce sample output.

 

7.  Link the Input function to the SQL-WHERE Condition and link the SQL_Where result output to the text file Rows, as shown below.

8.  Use the Save icon to save your transformation map. Note that the messages area at the bottom left of Mapforce should look like the following:

9.  Select Output tab. Provided you specified a default value in the Input parameter, this will show the employees which will be selected. Note: this view has been scrolled to the right, to show the Department Description column which has been retrieved from the related table DEPTAB.

10.Close Mapforce.