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:
- 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"
- Uses the <current business plan> name as the table name in the task log. For example, Packaging Plan.
- 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> - Commits changes if the records are successfully deleted.
- Logs an error message and does not continue with the processing if an error occurs during deletion.
- Completes the task log record with the actual status.