I'm fooling around with creation of packages and have created a few stored procedures that I want to put into a package so that I can only have one public stored procedure accessible from the package.
But in doing so I am unable to create a package. Even a very simple 'test' package fails.
The test package I'm trying to create is:
CREATE OR REPLACE PACKAGE TEST
FUNCTION SampleFunction (VARNAME VARCHAR(128)) RETURN integer;
When I try to create the package I get the error message:
BANK.TEST: 1: An unexpected token "PACKAGE" was found following
"CREATE OR REPLACE ". Expected tokens may include: "VIEW"..
SQLCODE=-104, SQLSTATE=42601, DRIVER=3.64.106
An unexpected token "PACKAGE" was found following "CREATE OR REPLACE
". Expected tokens may include: "VIEW".. SQLCODE=-104,
No, i did not check that. But did now. I was triggered by the page being about Oracle stuff, and all I wanted was just plain DB2. This triggered me in that I should not try to use PL/SQL packages (Oracle) but SQL PL modules (DB2).
That made me dive into the DB2 modules and all worked out fine. I've created the modules I wanted.. And they are not that different from PL/SQL packages...