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;
Then add the call to the procedure:
CALL [METABASE].Ws_Maintain_Indexes(p_sequence, p_job_name, p_task_name, p_job_id, p_task_id
, 'load_customer', NULL, NULL, 'DROP ALL', 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 maintain indexes.';
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_Maintain_Indexes(1,'Maintain Ind','Ind',0,0,'load_customer',NULL,NULL,'DROP ALL',?)
The following out is typical:
Value of output parameters
--------------------------
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_Maintain_Indexes(1,'Maintain Ind','Ind',0,0,'load_customer',NULL,NULL,'DROP ALL',?)}
Ws_Version_Clear
This function performs the removal of old version entries. The number of days is specified and all older versions are deleted, so long as number of versions is also maintained. If days to keep is specified then deletes based on today - days to keep being on or after the version creation date. If no days to keep specified then the test is that the retention date on the version record is prior to today.