SunQuest
           DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 11th, 2006, 05:41 AM
dlare9 dlare9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Location: somewhere
Posts: 33 dlare9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 4 h 10 m 46 sec
Reputation Power: 3
Access two database in db2 at the same time (in C)

Hi to all,

I've created a C application that does DB2 access.
At first both are precompiling and binding work fine.
I was able to insert and retreive data from the database.

However, when I tried to add another process the output is not what I expected. Basically the process mentioned here is a conditional statement, saying that if a certain condition is not met, then the application would connect to another database.
When I first ran the application (expecting that it will connect to the "other" database I've created in DB2) I was able to connect successfully to the "other" database (through logging function that I've added). But when I try to Insert (and even run Select querry) a data to the "other" database I got a -805 error:
package not found in the database.


After googling I've found an answer (check the
command reference for a description of the 'PRECOMPILE PROGRAM' (='PREP') command)
. And that got me thinking about the .bat file I'm using to precompile and bind my Embeded SQL code (in C). I've made some modification to the .bat file (w/c basically calls the embprep.bat ) ,namely the name of the database.

Then ran the application again (expecting that it will connect to the "other" database I've created in DB2) and this time I was able to Insert and retrieve data from the "other" database.

Is there a way to access two database in db2 at the same time (in C)?
I've tried to google and search this forum about this problem, but I found no meaningful answer (or maybe I'm using the wrong search keys..)

any help would be much appreciated.

Regards,
dlare9



***note***
I'm using MVC6 and my OS is win2k.
My database is : DB2 Universal Database Personal Edition , Version 8.1

As you can tell by my post, I'm still learning about making application that access db2. Most of the code that I've made were sample from the web , only edited some parts to my liking

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Access two database in db2 at the same time (in C)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway