Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Multiple DB Connection Problem

by snoopy (Deacon)
on May 31, 2007 at 06:43 UTC ( #618412=note: print w/ replies, xml ) Need Help??


in reply to Multiple DB Connection Problem

I think its the connection string. The following gives the same error:

#!/usr/bin/perl use warnings; use strict; use DBI; my $dbconnectionstring = q{"dbi:Oracle:host=10.0.0.1;sid=dev;","querye +ditor","editor"}; our $conn2 = DBI->connect($dbconnectionstring); die($DBI::errstr) unless $conn2;
You need to parse your connection string to extract dsn, user and password and pass then as individual arguments to DBI's connect method:
use Text::CSV_XS; my $csv = Text::CSV_XS->new({ sep_char => ",", quote_char => '"', }); $csv->parse($dbconnectionstring); my ($dsn,$user,$pass) = $csv->fields(); our $conn2 = DBI->connect($dsn, $user, $pass); die($DBI::errstr) unless $conn2;


Comment on Re: Multiple DB Connection Problem
Select or Download Code
Replies are listed 'Best First'.
Re^2: Multiple DB Connection Problem
by slg_saravanan (Initiate) on May 31, 2007 at 09:10 UTC
    Snoopy..Thanks for the suggestion.

    Is there any other way to do this multiple DB connection without using "use Text::CSV_XS;" module ?
      You could split $dbconnectionstring on commas or if it were me, I would store the information in 3 different columns.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://618412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2015-07-28 23:04 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 (260 votes), past polls