英文:
PLS-00103 caused by PL SQL Declare keyword
问题
I am learning PL SQL and running the below code --
创建或替换过程 PROCEDURE1 AS
DECLARE
c VARCHAR2(60 CHAR);
BEGIN
c := 'abc ';
END;
END PROCEDURE1;
However, this is giving an error like below ==
错误(3,1):PLS-00103:遇到符号"DECLARE"时,期望以下之一:begin function pragma procedure subtype type current cursor delete exists prior external language
有什么帮助可以解释为什么出现此错误以及如何解决它?
英文:
I am learning PL SQL and running the below code --
create or replace PROCEDURE PROCEDURE1 AS
DECLARE
c VARCHAR2(60 CHAR);
BEGIN
c := 'abc ';
END;
END PROCEDURE1;
However, this is giving error like below ==
Error(3,1): PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: begin function pragma procedure subtype type current cursor delete exists prior external language
Any help why this error is coming and how this can be removed?
答案1
得分: 0
"It's not 'paste a working anonymous block between 'create' and 'end'. In a procedure the DECLARE and END statement are not needed. The CREATE PROCEDURE will service as DECLARE and the END [PROCEDURE_NAME]; serves as end. Google 'Oracle create procedure syntax' for more info.
create or replace PROCEDURE PROCEDURE1 AS
c VARCHAR2(60 CHAR);
BEGIN
c := 'abc ';
END PROCEDURE1;
"
英文:
It's not "paste a working anonymous block between "create" and "end". In a procedure the DECLARE
and END
statement are not needed. The CREATE PROCEDURE
will service as DECLARE
and the END [PROCEDURE_NAME];
serves as end. Google "Oracle create procedure syntax" for more info.
create or replace PROCEDURE PROCEDURE1 AS
c VARCHAR2(60 CHAR);
BEGIN
c := 'abc ';
END PROCEDURE1;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论