帮忙看一下这个存储过程错在哪里?
CREATE OR REPLACE PROCEDURE REPORT AS
V_SUM NUMBER;
BEGIN
CURSOR C1 IS SELECT * FROM PARAMETER;
BEGIN
FOR cur_result in cur LOOP
BEGIN
V_SUM := P_COURSE_ID;
END;
END LOOP;
END REPORT;
================================
Error(4,9): PLS-00103: Encountered the symbol "C1" when expecting one of the following: := . ( @ % ;
提示C1有问题。
------解决方案--------------------BEGIN
CURSOR C1 IS SELECT * FROM PARAMETER;
多了个Begin,
FOR cur_result in cur LOOP
cur应该为C1 吧
------解决方案--------------------CREATE OR REPLACE PROCEDURE REPORT AS
V_SUM NUMBER;
BEGIN
CURSOR C1 IS SELECT * FROM PARAMETER;
BEGIN
FOR cur_result in c1 LOOP
BEGIN
V_SUM := P_COURSE_ID;
END;
END LOOP;
END REPORT;