Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    23

    Unanswered: Create package error

    Hi all,

    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:
    Code:
    CREATE OR REPLACE PACKAGE TEST
    AS
    	FUNCTION SampleFunction (VARNAME VARCHAR(128)) RETURN integer;
    END TEST;
    When I try to create the package I get the error message:
    Code:
    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, 
    SQLSTATE=42601, DRIVER=3.64.106
    When I reference the documentation (Creating package specifications (PL/SQL) - IBM DB2 9.7 for Linux, UNIX, and Windows) I don't see what I am doing wrong....

    Does anybody know what I am doing wrong?

    I'm on:
    Windows 7
    DB2 AESE 9.7 fixpack 7

    Thanks in advance for your replies!
    Kind regards,

    Bert

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by Baddus View Post

    When I reference the documentation (Creating package specifications (PL/SQL) - IBM DB2 9.7 for Linux, UNIX, and Windows) I don't see what I am doing wrong....
    Did you reference this first: Setting up DB2 for Oracle application enablement - IBM DB2 9.7 for Linux, UNIX, and Windows
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Feb 2012
    Posts
    23
    Hi n_i

    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...

    Thanks for your reply!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •