Cleanup

The EXECUTE_GENERATE_BUSPLAN_HORIZON program deletes the publish horizon data for each business plan in scope from previous runs of the program as follows:
  1. Logs new task record for the current business plan using this task_name format: <current business plan> - “CLEANUP”

    Example: "EXECUTE_GENERATE_BUSPLAN_HORIZON - Packaging Plan - CLEANUP"

  2. Uses the <current business plan> name as the table name in the task log. For example, Packaging Plan.
  3. Deletes existing records from the SZ_BUSINESS_PLAN_PUBLISH_HORIZON table for each business plan in the <current business plan>, as follows:
    DELETE FROM SZ_BUSINESS_PLAN_PUBLISH_HORIZON
    WHERE business_plan_name =  <current business plan>
    
  4. Commits changes if the records are successfully deleted.
  5. Logs an error message and does not continue with the processing if an error occurs during deletion.
  6. Completes the task log record with the actual status.