Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

( #142882=categorized question: print w/ replies, xml ) Need Help??
Contributed by mr_perl2002 on Feb 02, 2002 at 04:49 UTC
Q&A  > database programming


Description:

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?

Thanks,
The Rookie

Answer: What is required to use Perl on Solaris to connect to MS-SQL?
contributed by andreychek

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!
Answer: What is required to use Perl on Solaris to connect to MS-SQL?
contributed by gellyfish

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.

Answer: What is required to use Perl on Solaris to connect to MS-SQL?
contributed by Zombie jklowden

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 www.freetds.org.

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

Answer: What is required to use Perl on Solaris to connect to MS-SQL?
contributed by lachoy

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.

Answer: What is required to use Perl on Solaris to connect to MS-SQL?
contributed by mpeppler

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

Answer: What is required to use Perl on Solaris to connect to MS-SQL?
contributed by Anonymous Monk

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

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (3)
    As of 2014-07-10 04:22 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (198 votes), past polls