According to KB14959, a Freeform SQL report can be used to call the stored procedures in DB2 database and retrieve data. In some cases, it may be desired to invoke a table function instead of stored procedure in the data warehouse.
The following example demonstrate the process of calling a table function "Get_Emps()" in a DB2 database.
EXAMPLE:

Drop function Get_Emps ();
create function CTC_Get_Emps (IN EmpID INTEGER)
Returns Table (
Emp Numeric,
FirstName VARGRAPHIC(50),
LastName VARGRAPHIC(50)
)
Language SQL reads SQL data Return
(
Select EMP_ID, EMP_FIRST_NAME, EMP_LAST_NAME from LU_EMPLOYEE
Where EMP_ID=EmpID
);


Here is the process: The prompt answer is 3 and passed as parameter to the table function, which returns back a table with all information of employee whose ID is equal to 3. And the FFSQL report retrieves Employee ID, Employee First Name and Employee Last Name from the table, as shown in the image above.
Third party code/SQL:
Strategy Technical Support does not provide customized SQL queries. The syntax and the error messages shown in this document can vary depending on the database. Please contact your database administrator to obtain the correct syntax for any desired customized SQL.