DBI Gurus,
 
I've been trying to write a common perl script that connects to either
Oracle or DB2 database. All code lines within the script are same for
both database platform. Depending on database platform identifier
supplied during runtime ("O" for Oracle and "D" for DB2) it would
connect to appropriate database platform. 
 
When I compile or (execute) this script to connect to Oracle database
from the machine on which DB2 client is not installed, it errors out
with following message:
 
 "This application has failed to start because DB2CLI.dll was not
found.Re-installing the application may fix this problem".
 
Below is code lines to use library for Oracle or DB2:
 
if ($opt_p eq "O") {

$DBType = "Oracle";

use DBD::Oracle;

};

if ($opt_p eq "D") {

$DBType = "DB2";

 use DBD::DB2;

};

If I comment "use DBD::DB2;" line out and then compile it it works fine.


At this point the only workaround I found is, create two separate
scripts for each database platform and compile/execute the script on
machine where appropriate DBD module installed.

Is there any work around to get passed this problem without installing
DB2 libraries on the machine. Obliviously, client do not want install
DB2 libraries on which Oracle database is running and vice-a-versa.

How can I make a perl script from database library independent. We're
planning to use this script against SQL server and UDB database platform
and seem that we need to maintain four different code lines for each
database platform.

Any input would be greatly appreciated.


Thanks,

Hetal.

 

 

 

 

 



NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is strictly prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies and attachments of the original message.

Reply via email to