Callable Procedures > DB2 Examples:
  
DB2 Examples:
1. DB2 example of a call from a Stored Procedure:
Add the following to the declaration section of the stored procedure:
DECLARE v_table_name VARCHAR(256);
Then add the call to the procedure:
CALL [METABASE].WsParameterReadG('$$TABLE_NAME', p_job_id, p_task_id, v_table_name);
2. DB2 example of a call from the DB2 Command Line Processor (db2.exe):
Enter the following after connecting (the metadata is in a schema called QAD Data Warehouse Designer):
call Data Warehouse Designer.WsParameterReadG('$$TABLE_NAME',0,0,?)
The following out is typical:
Value of output parameters
--------------------------
Parameter Name : P_VALUE
Parameter Value : load_customer
 
Return Status = 0
3. DB2 example of a call from QAD SQL Admin (the metadata is in a schema called QAD Data Warehouse Designer):
{Call Data Warehouse Designer.WsParameterReadG('$$TABLE_NAME',0,0,?)}
 
WsParameterReadJ
This function reads job information and attributes. It is called by procedures wishing to retrieve information stored against the job that is executing them.