If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > can not find packge when Running SQC program on another machine

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-11, 11:43
Nesreen Mahmoud Nesreen Mahmoud is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
Post 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 12:04.
Reply With Quote
  #2 (permalink)  
Old 11-15-11, 23:47
Nesreen Mahmoud Nesreen Mahmoud is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On