develooper Front page | perl.dbi.users | Postings from April 2007

Gofer to PC (was: Is PERL --> MS SQL really that difficult?)

Thread Previous | Thread Next
From:
Tim Bunce
Date:
April 26, 2007 01:51
Subject:
Gofer to PC (was: Is PERL --> MS SQL really that difficult?)
Message ID:
20070426085136.GC11416@timac.local
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:user@pc.your.domain.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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About