小编典典

错误(5,3):PLS-00103:在预期以下情况之一时遇到符号“ EGIN”:语言

sql

尝试使用一个过程创建简单的程序包:

CREATE OR REPLACE 
PACKAGE PACKAGE1 AS

procedure procHTML1 is
begin
htp.print('
<html>
 <head>
  <title>PL/SQL Example Pages</title>
 </head>
<body>');
end procHTML1;

END PACKAGE1;

但是我明白了

Error(5,3): PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:     language 
Error(14,5): PLS-00103: Encountered the symbol "PACKAGE1" when expecting one of the following:     ;

任何帮助将不胜感激


阅读 193

收藏
2021-04-22

共1个答案

小编典典

包装由包装规格和包装主体组成。您在规范中声明了该过程(假设您希望该过程是公共的)并在主体中实现它。

因此,例如,您将创建包装规格

CREATE OR REPLACE PACKAGE package1
AS
  PROCEDURE procHTML1;
END package1;

然后,您将创建包主体

CREATE OR REPLACE PACKAGE BODY package1
AS
  PROCEDURE procHTML1
  AS
  BEGIN
    htp.print( '<<some HTML>>' );
  END procHTML1;
END package1;
2021-04-22