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;
but I get
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: ;
Any help will be appreciated
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;
And then you would create the package body
CREATE OR REPLACE PACKAGE BODY package1
AS
PROCEDURE procHTML1
AS
BEGIN
htp.print( '<<some HTML>>' );
END procHTML1;
END package1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With