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_last_invoice_id varchar(256);
Then add the call to the procedure:
CALL [METABASE].WsParameterWrite('LAST_INVOICE_ID', v_last_invoice_id, 'The last invoice id loaded');
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.WsParameterWrite('LAST_INVOICE_ID', '123456', 'The last invoice id loaded')
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.WsParameterWrite('LAST_INVOICE_ID', '123456', 'The last invoice id loaded')}
 
WsWrkAudit
This procedure writes a row to the audit log ws_wrk_audit_log. It is called by procedures wishing to log audit information.