Please enable JavaScript to view this site.

Fully qualified table names in Db2 frequently contain very long fully qualified schemas. In order to shorten the name when it is used to qualify columns in Apply Engine scripts an ALIAS is often used.

In the example database one table is named HumanResources.EmployeeDepartmentHistory which contains the column StartDate. The ALIAS parameter can be used to shorten the table name to something more manageable using the syntax below:

DESCRIPTION DB2 ALIAS(

HumanResources.EmployeeDepartmentHistory_StartDate AS HR.Dept_StartDate

HumanResources.EmployeeDepartmentHistory_EmployeeID AS HR.Dept_EmployeeID

HumanResources.EmployeeDepartmentHistory_DeptID AS HR.Dept_DeptID

HumanResources.EmployeeDepartmentHistory_ShiftID AS HR.Dept_ShiftID)

 

Then in a subsequent procedure statement in the script a reference to StartDate could look like this:

If HR.Dept_StartDate < V_Current_Year

 

Rather than:

If HumanResources.EmployeeDepartmentHistory_StartDate < V_Current_Year