错误(5,3):PLS

编程入门 行业动态 更新时间:2024-10-26 20:33:09
本文介绍了错误(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

本文发布于:2023-07-22 10:39:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1186767.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   PLS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!