Skip to Content.
Sympa Menu

freetds - Re: [freetds] connecting to two databases with the same name but ondifferent servers

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Reid, Roger L." <roger.reid AT dpw.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] connecting to two databases with the same name but ondifferent servers
  • Date: Fri, 20 Jul 2007 15:54:12 -0400

The stuff between the [] is a server alias, not a database name.

Now, if you have a one database server, and you call the server and database
the same thing that might not be obvious.

It would help to know what doesn't work, what error, whatever. But your 2
servers are [rmengDb] and [rmengDb2].

If you're database is called rmengDb on both boxes, that's what you'll want
to specify for the DATABASE.

In my shop we always do an explict "use <database>" call....I think it can be
on the connection string like this

"DBI:Sybase:server=rmengDb2,database=rmengDB"

but I havn't used it in a while: check the CPAN page on DBI and you should be
OK. Just remember that the config
entry is the dataserver, not the database.






-----Original Message-----
From: Chris Brookes [mailto:cbrookes AT gmail.com]
Sent: Thursday, July 19, 2007 4:12 PM
To: freetds AT lists.ibiblio.org
Subject: [freetds] connecting to two databases with the same name but
ondifferent servers

I'm using freetds-0.62.4 on Solaris to access a SQL Anywhere database
(ciscoworks) from perl using DBD-Sybase=1.08. It works great. My
freetds.conf entry is:

[rmengDb]
host = server.domain.com
port = 43455
tds version = 5.0

My connect string in perl:

$cw = DBI->connect("DBI:Sybase:rmengDb", $user, $passwd)


I have another Ciscoworks box that I need to access from the same
script, so I configure another entry like this:

[rmengDb2]
host = server2.domain.com
port = 43455
tds version = 5.0

But this doesn't work when I called Sybase:rmengDb2 from a connect in
perl. I think I remember reading somewhere originally that the name in
[] is used as the database to connect to? I can't have the same
definition [] twice in the freetds.conf, so where does that leave me?

It seems like there is a ;database=whatever parameter you can add to
the DBI connect string but I can't seem to get it to work.

Is there a solution for this?

Any help appreciated

Cheers
C





Archive powered by MHonArc 2.6.24.

Top of Page