내가 같은 오류가 점점 오전에 :오류 : 00103 PLSQL 절차
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.
내 코드는 다음과 같습니다
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' 키워드를 제거합니다. CREATE PROCEDURE의 구문을 참조하십시오. https://docs.oracle.com/database/121/LNPLS/create_procedure.htm#LNPLS01373 Threre는'IS/AS' 키워드 바로 뒤에 * declre_section *이지만이 절은 ** 포함하지 않습니다. DECLARE 키워드 **. 이 키워드는 익명 블록 및 트리거에서만 사용됩니다. – krokodilko