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_current_date varchar(256);
DECLARE v_comment varchar(256);
Then add the call to the procedure:
CALL [METABASE].WsParameterRead('CURRENT_DATE',v_current_date,v_comment);
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.WsParameterRead('CURRENT_DATE',?,?)
The following out is typical:
Value of output parameters
--------------------------
Parameter Name : P_VALUE
Parameter Value : 2009-01-12
Parameter Name : P_COMMENT
Parameter Value : This is the current date for processing
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.WsParameterRead('CURRENT_DATE',?,?)}
WsParameterReadG
This function reads a global parameter value. It is called by procedures wishing to retrieve information from the metadata.