Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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;","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.



What could be the problem ? Is that the problem coz of am opening the same connection again ..?

Thanks a ton in Advance !

Warm Regards,
Saravanan

In reply to Multiple DB Connection Problem by slg_saravanan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (14)
    As of 2015-07-31 21:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (282 votes), past polls