gpt4 book ai didi

sql - 错误(5,3) : PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: language

转载 作者:行者123 更新时间:2023-12-04 16:15:43 24 4
gpt4 key购买 nike

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

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

任何帮助将不胜感激

最佳答案

包由包规范和包体组成。您在规范中声明过程(假设您希望过程是公开的)并在正文中实现它。

因此,例如,您将创建包规范

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;

关于sql - 错误(5,3) : PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: language,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10657775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com