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_job_name varchar(256);
Then add the call to the procedure:
CALL [METABASE].WsParameterReadJ('NAME', p_job_id, v_job_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.WsParameterReadJ('NAME',60,?)
The following out is typical:
Value of output parameters
--------------------------
Parameter Name : P_RESULT
Parameter Value : New Daily Run
 
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.WsParameterReadJ('NAME',60,?)}
 
WsParameterWrite
This procedure writes a parameter value, or adds a new parameter. It is called by procedures wishing to store information external to the procedure. These parameters can be maintained from QAD Data Warehouse Designer or from other procedures.