I am getting error such as:
Error(5,1): PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: begin function pragma procedure subtype type <an identifier> <a double-quoted delimited-identifier> current cursor delete exists prior external language The symbol "begin" was substituted for "DECLARE" to continue.
Error(5,1): PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: begin function pragma procedure subtype type <an identifier> <a double-quoted delimited-identifier> current cursor delete exists prior external language The symbol "begin" was substituted for "DECLARE" to continue.
and my code is:
CREATE OR REPLACE PROCEDURE procExplicitCursorAccountSlct
AS
DECLARE
CURSOR C1 IS SELECT * FROM ACCOUNT;
BEGIN
OPEN C1;
FOR i in C1 LOOP
FETCH C1 INTO ID,ACCOUNTTYPE,BALANCE;
EXIT WHEN C1%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(ID||'-'||ACCOUNTTYPE||'-'||BALANCE);
DBMS_OUTPUT.PUT_LINE(C1%ROWCOUNT);
END LOOP;
CLOSE C1;
END;
DECLARE
keyword. Refer to the syntax of CREATE PROCEDURE: docs.oracle.com/database/121/LNPLS/… Threre is declre_section directtly afterIS/AS
keyword, but this section doesnt containt DECLARE keyword. This keyword is used only in anonymous blocks and in the triggers. – krokodilko