slg_saravanan has asked for the wisdom of the Perl Monks concerning the following question:
When I try to connect more than one Database through my Perl code.It is giving the following error :
$ENV{ORACLE_HOME}="/home/oracle/product/10.2.0/db_1"; our $conn1 = DBI->connect("dbi:Oracle:host=10.0.0.1;sid=dev;","queryed +itor","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("E +rror 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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiple DB Connection Problem
by snoopy (Curate) on May 31, 2007 at 06:43 UTC | |
by slg_saravanan (Initiate) on May 31, 2007 at 09:10 UTC | |
by Mr. Muskrat (Canon) on May 31, 2007 at 16:26 UTC |