These look like some great options and I will keep them in mind for
future projects, especially DBI::Gofer. In this instance, however,
the server I am working with is "production frozen" so to speak and I
cannot install anything on it at all. All I can do is ask it for
information. I am pursuing the other ideas offered (sybase, connect
() syntax improvements, etc) for now. Thanks for the tips!
Robert
On Apr 26, 2007, at 4:51 AM, Tim Bunce wrote:
On Wed, Apr 25, 2007 at 05:24:40PM -0400, Robert Denton wrote:
Is it just me, or is using perl on a linux server to extract
information from an MS SQL server insanely difficult? Has no one
else struggled with this? Here is my set up:
FC4 -> PERL w/DBI -> DBD::ODBC -> unixODBC -> FreeTDS
The irony is that all I need to do is a single simple select from a
single table, and this is something I would run once a day. Yet the
process of getting perl to talk to an MSSQL server seems
disproportionately convoluted.
You could also take a look at DBD::Proxy. That would let you use
DBD::ODBC on a windows PC with a genuine MSSQL ODBC driver.
But you'd need to run a DBI Proxy Server on the PC.
DBD::Gofer would let you do something similar but in a different
kind of way.
You'd need perl, DBI, and DBD::ODBC installed on the PC. Then test
your
script on the PC to make sure it works and the DSN is correct.
If you can ssh into the PC [1] then using DBD::Gofer may be as simple
as this...
Copy the script over to the unix box. No need to change the DSN at
all.
Set the DBI_AUTOPROXY env var to something like this:
DBI_AUTOPROXY='dbi:Gofer:transport=stream;url=ssh:[EMAIL PROTECTED]
com'
then just run the script!
The DBI_AUTOPROXY setting will arrange for DBD::Gofer to be used to
proxy the requests via an ssh connection to your PC.
There's no need to have a 'gofer server' running on the PC. The gofer
stream transport starts the gofer server-side code once it has
connected to the PC.
I'm hoping more people will start using gofer and get involved in
helping shape its development.
Tim.
[1] http://www.google.com/search?q=ssh+windows