Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

What is required to use Perl on Solaris to connect to MS-SQL?

by mr_perl2002 (Initiate)
on Feb 02, 2002 at 04:49 UTC ( #142882=perlquestion: print w/replies, xml ) Need Help??

mr_perl2002 has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone have any good install, configuration documentation?

I am having trouble with using DBI, iODBC, and DBD::ODBC; or DBI, FreeTDS, and DBD::Sybase.

Are these correct? Are iODBC and FreeTDS both driver managers? Is unixODBC a complete package w/ the driver and manager?

Originally posted as a Categorized Question.

  • Comment on What is required to use Perl on Solaris to connect to MS-SQL?

Replies are listed 'Best First'.
Re: What is required to use Perl on Solaris to connect to MS-SQL?
by andreychek (Parson) on Feb 02, 2002 at 07:47 UTC
    You don't state what version of SQL Server you're using. In general though -- if SQL Server is configured to listen for connections on a port (as opposed to something like named pipes), you should be able to get it to work.

    One method works is to install the latest version of FreeTDS (which is currently 0.53). Then edit /etc/freetds.conf (or where ever the installation put it) and insert the settings that correspond to your database (hostname, username, password, etc).

    Then, install DBD::Sybase, and you should be good to go. Just be sure to insert the following code at the top of all your scripts using the database:
    BEGIN { $ENV{SYBASE} = '/usr'; }
    Substitute /usr for the actual prefix FreeTDS was installed under on your system.

    Without this code, or when using incorrect parameters to send to the database, it often just segfaults. The FreeTDS and DBD::Sybase docs should be able to help you get the correct parameters to use though. Good luck!
Re: What is required to use Perl on Solaris to connect to MS-SQL?
by gellyfish (Monsignor) on Feb 04, 2002 at 12:59 UTC

    As well as being ability to build DBD::Sybase against FreeTDS there is also DBD::FreeTDS which whilst not as mature as DBD::Sybase should be free of the problem that lachoy mentions.

Re: What is required to use Perl on Solaris to connect to MS-SQL?
by jklowden (Initiate) on Feb 20, 2002 at 21:28 UTC
    The author of DBD::Sybase, Michael Peppler, keeps it current. He coordinates his work with us on FreeTDS, and is very helpful in guiding the FreeTDS CT-lib implementation. DBD::Sybase + FreeTDS is the most mature open-source platform you'll find for connecting unixy clients to MS SQL Server.

    There were some niggles with the latest releases (DBD::Sybase 93 and FreeTDS 53), but that's all solved now. Far from using older versions, I'd advise taking the nightly snapshot from http://www.freetds.org>www.freetds.org.

    If you want to use ODBC, have a look at the FreeTDS User Guide first, to see what's what.

Re: What is required to use Perl on Solaris to connect to MS-SQL?
by lachoy (Parson) on Feb 02, 2002 at 17:02 UTC
    In addition to what andreychek said, be sure to read the FAQ for FreeTDS. Newer versions of DBD::Sybase are said to be more reliant on functions only in the Sybase Open Client libraries so you need to use a slightly older one.

Re: What is required to use Perl on Solaris to connect to MS-SQL?
by Anonymous Monk on Jul 21, 2003 at 18:53 UTC
    I successfully connect to MS-SQL 2000 from a Solaris box. Here is a list of what I used and in the order in which I compiled and installed the packages:
    • freetds-0.61
    • DBD-Sybase-0.91
    # Here's my connection string my $dbh = DBI->connect("dbi:Sybase:server=DDSql;database=toto", 'sa', +'pass', { RaiseError => 1, AutoCommit => 0 });
    where DDSql is a DNS established in the freetds.conf file. It looks something like:
    [DDSql] host = 10.10.1.44 port = 1433 tds version = 8.0 emulate little endian = yes
Re: What is required to use Perl on Solaris to connect to MS-SQL?
by mpeppler (Vicar) on Feb 21, 2002 at 19:17 UTC
    Friend lachoy is correct - DBD::Sybase does use a wider range of Client Library API calls in recent versions.

    However, FreeTDS is progressing nicely so that all versions of DBD::Sybase build with the current release (AFAIK), even though some of the functionality won't work, or won't work correctly.

    I try to keep an eye on the FreeTDS developpment (even though I don't actually do any of the coding myself) to keep track of the most important issues.

    Michael

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2021-04-19 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?