Callable Procedures > DB2 Examples:
  
DB2 Examples:
1. DB2 example of a call from a Stored Procedure:
Add the call to the procedure:
CALL [METABASE].WsWrkAudit('I', p_job_name, p_task_name, p_sequence
, 'This is a Message', NULL, NULL, p_task_id, p_job_id);
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.WsWrkAudit('I','Audit Msg','Audit',1,'This is a Message.',NULL,NULL,0,0)
The following out is typical:
Return Status = 1
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.WsWrkAudit('I','Audit Msg','Audit',1,'This is a Message.',NULL,NULL,0,0)}
 
WsWrkAuditBulk
This procedure writes a number of message rows to the audit log ws_wrk_audit_log. It is called by procedures wishing to log audit information in bulk. The normal practice however is to record detailed information in the audit trail. It is recommended that entries are restricted to a maximum of 10 rows per job. Detailed information should be written to the detail/error log ws_wrk_error_log.