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_result INTEGER;
DECLARE v_return_code VARCHAR(1);
DECLARE v_return_msg VARCHAR(256);
Then add the call to the procedure:
CALL [METABASE].Ws_Connect_Replace(p_sequence, p_job_name, p_task_name, p_job_id, p_task_id
, 'REPLACE', 'CONN_TEST2', 'CONN_TEST1'
, v_return_code, v_return_msg, v_result);
Perhaps add a check of the result:
IF ( v_result <> 1 ) THEN
SET p_status = v_result;
SET p_return_msg = 'Failed to replace connection details. Return Code was ' || RTRIM(v_return_code);
SET p_return_msg = p_return_msg || '. ' || RTRIM(v_return_msg);
END IF;
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.Ws_Connect_Replace(0,'Change Conn','Conn',0,0,'REPLACE','CONN_TEST2','CONN_TEST1',?,?,?)
The following out is typical:
Value of output parameters
--------------------------
Parameter Name : P_RETURN_CODE
Parameter Value : S
Parameter Name : P_RETURN_MSG
Parameter Value : Connection information for CONN_TEST1 replaced from CONN_TEST2
Parameter Name : P_RESULT
Parameter Value : 1
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.Ws_Connect_Replace(0,'Change Conn','Conn',0,0,'REPLACE','CONN_TEST2','CONN_TEST1',?,?,?)}
Ws_Job_Clear_Archive
This procedure allows the removal of old job archive logs generated by the callable procedure Ws_Job_Clear_Logs and Ws_Job_Clear_Logs_By_Date. The number of days of logs to retain is specified and all older logs are deleted. If zero is specified all logs are deleted. For example if 90 is specified then logs older than 90 days old are removed.