Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    2

    Post Unanswered: can not find packge when Running SQC program on another machine

    Hi all,

    I have created a DB29.7 database named "MyDB1" on my machine using user "user1" which is administrator user.
    then created SQC program that contains simple select statement and compiled it successfully using the following command:

    db2 prep simpleselect.sqc bindfile PACKAGE DYNAMICRULES RUN VALIDATE RUN

    then created the program required packages by using the bind command.
    the C++ program(VC++2005) works fine and can connect and retrieve data from data base.

    then, I wanted to run the program on another machine(other DB2 Server), on the other machine I created the same database but with different name "MyDB2" and different administrator user "user2" but same tables.

    then using the BIND command to create the required data base, I used the following BIND command:

    db2 BIND simpleSelect.bnd ACTION ADD OWNER user2 QUALIFIER user2 COLLECTION user2 GRANT PUBLIC DYNAMICRULES RUN VALIDATE RUN

    the database package created under the new database "MyDB2" successfully.
    when I run the C program, it connects successfully to the database "MyDB2" but when trying to execute the SQL statement it generates the following error

    SQL005N Package "user1.SIMPLESE" was not found.


    how can I force the program to use the authentication of the current connection as refrence to the required DB package??

    I appreciate your help.
    Last edited by Nesreen Mahmoud; 11-15-11 at 13:04.

  2. #2
    Join Date
    Nov 2011
    Posts
    2

    Cool set the package path

    I have solved the issue,
    in the SQC file, add the following statement:

    EXEC SQL SET CURRENT PACKAGE PATH :chrUID;
    where chrUID is the db user ID.

Posting Permissions

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