|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Access two database in db2 at the same time (in C) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|