错误(5,3):PLS-00103:遇到符号"BEGIN";当期望以下之一时:语言 [英] Error(5,3): PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: language

查看:569
本文介绍了错误(5,3):PLS-00103:遇到符号"BEGIN";当期望以下之一时:语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

trying to create simple package with one procedure:

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:     ; 

任何帮助将不胜感激

推荐答案

程序包由程序包规范和程序包主体组成.您可以在规范中声明该过程(假设您希望该过程是公共的),然后在主体中实现它.

A package is composed of a package specification and a package body. You declare the procedure in the specification (assuming you want the procedure to be public) and you implement it in the body.

例如,您将创建包装规格

So, for example, you would create the package specification

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;

这篇关于错误(5,3):PLS-00103:遇到符号"BEGIN";当期望以下之一时:语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆