|
|
|
|
|
If you selected By entering an SQL statement, you have to type the SQL statement to create a schema mapping. Specify a table join or union. You can use column functions in your SQL statement.
If you have selected your tables in the previous page of the SmartGuide, you can view the table column names while you are typing in the SQL statement. Select one of the tables listed in the Tables Selected list and the table's column names are displayed in the Columns list.
To enter the SQL statement:
SELECT PROJNO, PROJNAME, DEPTNO, RESPEMP, LASTNAME, SALARY+BONUS+COMM AS TOTAL_PAY FROM PROJECT, EMPLOYEE
SELECT PROJNO, PROJNAME FROM %QUAL%PROJECT
Your user ID is the default value for %QUAL%. Open the mapping properties notebook to view the Qualifier value. At run time you can use the setQualifier method to change the value of %QUAL%.
SELECT EMPNO FROM EMPLOYEE WHERE WORKDEPT=? UNION SELECT EMPNO FROM EMP_ACT WHERE PROJNO=?
The parameters are mapped as param1, param2, param3 and so forth. Use the next step of the SmartGuide, Schema Mapping Description, to document these parameters and the information will be added to the generated code.
Warning! If you are using DB2, the following lines must be in the DB2CLI.INI file in the SQLLIB directory, or else the validate action will return without an error message regardless of the SQL statement's actual validity:
[common] DEFERREDPREPARE=0
If you select Finish, a mapping will be created for the SQL statement.
![]()
Data Access Builder Workflow
Table Joins and Query Support
![]()
Start the SmartGuide
Previous SmartGuide Step: Select Tables
for Mapping
Next SmartGuide Step - Schema Mapping
Description
![]()
Data Access Builder SmartGuide
