Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: DBD::Sybase on Linux -- trouble?

by blue_cowdawg (Monsignor)
on Aug 01, 2012 at 19:32 UTC ( #984880=note: print w/replies, xml ) Need Help??

in reply to DBD::Sybase on Linux -- trouble?

Check out FreeTDS. I used to use that when I had to connect to Sybase and MSSQL database servers at a former job.

Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: DBD::Sybase on Linux -- trouble?
by tale051258 (Initiate) on Aug 01, 2012 at 20:17 UTC

    Alas, this is what I indeed am trying. But the instructions below are dated -- for example, step 5. is not needed in the newer release of the .pm and step 6. seems to me to be incorrect. The instructions I am referring to can be found at and are repeated here for clarity.

    You can't use CPAN to install the DBD::Sybase Perl drivers on Linux. T +here are a couple things that need to be tweaked by hand. 1. Download FreeTDS from This a free alternat +ive to Sybase's ct-lib library packages (which I couldn't find anywhe +re on their web or ftp sites, and which I wasn't willing to install t +he whole DB just to get). 2. Build FreeTDS: './configure --prefix=/usr/local/freetds; make; make + install'. 3. Open /usr/local/freetds/etc/freetds.conf and add a section for the +server you're using. An example: # This is an example Sybase server [SYBASE_EXAMPLE] host = ;host = port = 2025 tds version = 5.0 You'll use the string 'SYBASE_EXAMPLE' in your perl scripts as the +server to connect to, like so: my $dbh = DBI->connect("DBI:Sybase:server=SYBASE_EXAMPLE",'user' +,'pass'); 4. Download the DBD::Sybase tarball from +uthors/id/M/ME/MEWP/DBD-Sybase-0.95.tar.gz. (The online docs are at h +ttp:// 5. Edit DBD::Sybase's dbdimp.c (it's in the top of the untarred direct +ory), and change every cs_ctx_global() you find to cs_ctx_alloc(). Th +ere are probably four occurences to change, so do a global search and + replace. 6. Edit DBD::Sybase's CONFIG file (it's also right on top there). Add +the following lines: SYBASE=/usr/local/freetds EXTRA_LIBS=-linsck 7. Do the standard 'perl Makefile.PL; make; make install'. 8. Run a test script to make sure it all works.

    When doing step 7., I get the following error which (seems) to point to the fact that the Sybase libs cannot be found under freetds (or any subdirectory under which freetds is installed). There is not even a /lib or /lib64 directory under freetds. Please meditate with me and help in resolving this issue, oh enlightened ones.

    Error when compiling (i.e. running perl Makefile.PL): Can't find any Sybase libraries in /usr/local/freetds/freetds-0.91/lib + or /usr/local/freetds/freetds-0.91/lib64 at Makefile.PL line 146, <I +N> line 45.

      Did you look here? That set of directions seems to jive with what I remember from about 10 years ago when I did this last.

      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984880]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-11-23 02:44 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (328 votes). Check out past polls.