下面是系统日终时生成网点当日余额汇总数据的存储过程程序,请补全空缺处的代码。
CREATE PROCEDURE BranchBalanceSum(INs date char(8))
DECLARE
all_balancenumber(142);
v_bran_no varchar(10) ;
v_bran_name varchar(30);
(a) c_sum_bal IS
SELECT open_branch_no,open_branch_name,sum(a_bal)
FROM accounts GROUP BY open_branch_no,open_branch_name;
BEGIN
OPEN c_sum_bal;
LOOP
(b) c_sum bal INTO v_bran_no, (c) ;
IF c_sum_bal%%NOTFOUND THEN//未找到记录
(d);
END IF;
INSERT INTO branch_sum
VALUES(v_bran_no,s_date,v_bran_name,all_balance);
END LOOP;
CLOSE (e) ; COMMIT;
EXCEPTION WHEN OTHERS THEN
(f)
END;