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 > Data Access, Manipulation & Batch Languages > Perl and the DBI > Multiple DB Connection Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-07, 01:46
slg_saravanan slg_saravanan is offline
Registered User
 
Join Date: May 2007
Posts: 1
Multiple DB Connection Problem

Hi All,

When I try to connect more than one Database through my Perl code.It is giving the following error :
Software error: Can't connect to data source "dbi:Oracle:host=10.0.0.1;sid=dev;","queryeditor", "editor", no database driver specified and DBI_DSN env var not set at /usr/local/apache/cgi-bin/saravanan/queryeditor_dev/dbnameselection.cgi line 47
Following is the part of script :

$ENV{ORACLE_HOME}="/home/oracle/product/10.2.0/db_1";
our $conn1 = DBI->connect("dbi:Oracle:host=10.0.0.1;sid=dev;","quer yeditor","editor");
die($DBI::errstr) unless $conn1;

my $connection_detail = "select DBDESCRIPTION from qe_dbnamelist where DBNAME='$dbname'";
my $connection_records = $conn1->prepare($connection_detail) or die("Error on preparing the sql statement \n");
$connection_records->execute() or die("Error on getting the data from QE_GROUP \n");
print "Query String Part";
@connection_resultset= $connection_records->fetchrow_array;

$dbconnectionstring = $connection_resultset[0];
print $dbconnectionstring;
our $conn2 = DBI->connect($dbconnectionstring);
die($DBI::errstr) unless $conn2;
print "$dbname Database Successfully Connected !!!";

What actually I am trying to do is, I am fetching ORacle DB connection string (for Ex : "dbi:Oracle:host=10.0.0.1;sid=dev;","queryeditor", "editor") from one table and I am creating one more different DB connection using that DB connection string. So..during that time I am getting this error.

What could be the problem ?

Thanks a ton in Advance !

Warm Regards,
Saravanan
Reply With Quote
  #2 (permalink)  
Old 07-02-07, 23:38
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Put DBI->trace(4) before your problem connection and see if that sheds some light on what's going on. (The numbers go all the way up to 15, but 4 will probably be enough.)
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