in reply to Multiple DB Connection Problem
I think its the connection string. The following gives the same error:
You need to parse your connection string to extract dsn, user and password and pass then as individual arguments to DBI's connect method:#!/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;
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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Multiple DB Connection Problem
by slg_saravanan (Initiate) on May 31, 2007 at 09:10 UTC | |
by Mr. Muskrat (Canon) on May 31, 2007 at 16:26 UTC |
In Section
Seekers of Perl Wisdom