Every Monday morning, the Vantage Operations team manually runs the same 12-step sales report. It takes 40 minutes and often has errors. Your job is to build a stored procedure that accepts a date range, produces the full regional breakdown, calculates total revenue as an OUT parameter, uses IF/THEN logic to flag whether the target was met, and can be scheduled to run automatically.
IN start_date DATE โ report period startIN end_date DATE โ report period endOUT total_revenue DECIMAL โ populated by SELECT INTOSHOW PROCEDURE STATUS WHERE Db = 'ops_db';CALL weekly_report('2024-01-01', '2024-01-07', @total);SELECT @total;DROP PROCEDURE IF EXISTS weekly_report;The procedure is pre-written in the editor. Read through it carefully, then deploy it and test with CALL. Once deployed, register it in the Scheduler window to complete the automation objective.