PROCEDURE Gen_Customer_Statistics ( attr_ IN VARCHAR2 ) IS ptr_ NUMBER; name_ VARCHAR2(30); value_ VARCHAR2(2000); company_id_ VARCHAR2(10); customer_id_ NUMBER; ordered_by_ VARCHAR2(30); progress_ VARCHAR2(2000); status_ VARCHAR2(2000); BEGIN ptr_ := NULL; WHILE (Client_SYS.Get_Next_From_Attr(attr_, ptr_, name_, value_)) LOOP IF (name_ = 'COMPANY_ID') THEN company_id_ := value_; ELSIF (name_ = 'CUSTOMER_ID') THEN customer_id_ := Client_SYS.Attr_Value_To_Number(value_); ELSIF (name_ = 'ORDERED_BY') THEN ordered_by_ := value_; END IF; END LOOP; -- Progress info when starting the process progress_ := Language_SYS.Translate_Constant(lu_name_, 'START: Beginning statistics calculation for customer :P1', customer_id_); Transaction_SYS.Log_Progress_Info(progress_); -- Statistic calculation (dummy) NULL; -- Progress info when process is completed progress_ := Language_SYS.Translate_Constant(lu_name_, 'READY: Statistics calculation for customer :P1 ready', customer_id_); Transaction_SYS.Log_Progress_Info(progress_); -- Status info (serious problems) IF NOT Customer_API.Check_Valid(customer_id_) THEN status_ := Language_SYS.Translate_Constant(lu_name_, 'INVALID_CUSTOMER: Customer :P1 is not valid',customer_id_); -- 'WARNING' is Default Transaction_SYS.Log_Status_Info(status_); END IF; -- Status info (informational) IF NOT Customer_API.Statistics_Exist(customer_id_) THEN Status_ := Language_SYS.Translate_Constant(lu_name_, 'NO_STAT: No statistics were generated for customer :P1', customer_id_); Transaction_SYS.Log_Status_Info(status_, 'INFO'); END IF; @ApproveTransactionStatement(2013-11-07,abcdse) COMMIT; EXCEPTION WHEN OTHERS THEN @ApproveTransactionStatement(2013-11-07,abcdse) ROLLBACK; END Gen_Customer_Statistics;