Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Unanswered: CREATE PACKAGE error in DB2 Express-C 10.1

    Greetings!

    I'm using DB2 Express-C 10.1 and IBM Data Studio 3.1.1.
    I'm trying to create a simple package:

    Code:
    CREATE OR REPLACE PACKAGE DM_TEST
    IS
        FUNCTION SampleFunction RETURN INTEGER;
    END DM_TEST;
    
    
    CREATE OR REPLACE PACKAGE BODY DM_TEST
    IS
        FUNCTION SampleFunction RETURN BIGINT
        IS
        BEGIN
            RETURN 670;
        END;
    END;
    But I get an error:

    Code:
    DIME.DM_TEST: 4: Incorrect element "PACKAGE DM_TEST
    IS
        FUNCTION SampleFunction" after "CREATE OR REPLACE ". SQLCODE=-104, SQLSTATE=42601, DRIVER=4.13.111
    Can you help me in solving this problem?
    What change in query text?


    P.S. I'm sorry if my English is not good

  2. #2
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by dime-m View Post
    Greetings!

    I'm using DB2 Express-C 10.1 and IBM Data Studio 3.1.1.
    I'm trying to create a simple package:

    Code:
    CREATE OR REPLACE PACKAGE DM_TEST
    IS
        FUNCTION SampleFunction RETURN INTEGER;
    END DM_TEST;
    
    
    CREATE OR REPLACE PACKAGE BODY DM_TEST
    IS
        FUNCTION SampleFunction RETURN BIGINT
        IS
        BEGIN
            RETURN 670;
        END;
    END;
    But I get an error:

    Code:
    DIME.DM_TEST: 4: Incorrect element "PACKAGE DM_TEST
    IS
        FUNCTION SampleFunction" after "CREATE OR REPLACE ". SQLCODE=-104, SQLSTATE=42601, DRIVER=4.13.111
    Can you help me in solving this problem?
    What change in query text?


    P.S. I'm sorry if my English is not good
    I believe packages has to be enabled via DB2_COMPATIBILITY_VECTOR. What is the result of:

    Code:
    db2set
    --
    Lennart

  3. #3
    Join Date
    Oct 2012
    Posts
    2
    Quote Originally Posted by lelle12 View Post
    I believe packages has to be enabled via DB2_COMPATIBILITY_VECTOR. What is the result of:

    Code:
    db2set
    The result was: MYS

    I set the value of DB2_COMPATIBILITY_VECTOR to ORA, re-create database, and now everything works fine!

    Thanks!

Posting Permissions

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