Installing Sybase on Your Linux Server

There is a handy LinuxPlanet tutorial Installing Sybase on Your Linux Server.

Installing Sybase module for Python

If you are installing on a Linux machine, you should be able to simply do the following:

python install

To build the module for use with FreeTDS you can use the following commands:

python install

By default the FreeTDS compile is against FreeTDS 0.61. To compile with FreeTDS 0.60 you must specify the older release with the HAVE_FREETDS macro.

python build_ext -D HAVE_FREETDS=60 -U WANT_BULKCOPY
python install
Why the FreeTDS people use a string for the TDS_VERSION_NO define in tdsver.h is beyond me...

Installing on Windows systems

Installating on Windows Using the Free Windows Compiler

The Micorsoft Visual C++ 2005/2008 Express Edition compiler can be freely downloaded and used. It can compile the Sybase module for Python.

Installating on Windows Using the Free Borland Compiler

If you need to compile the module on Windows and do not have access to the Microsoft compiler you can use the free Borland compiler to build the Sybase module.

Andy Hood sent those instructions on using the Free Borland Compiler to build the Sybase module on Windows.

  1. Download compiler and install. Make sure compiler bin directory is on the path.
  2. Edit in the python21/Lib/distutils directory. On line 850 is the comment '#OS name mappings'. This section sets the default compiler for the operating system. Change the nt default from 'msvc' to 'bcpp'. Python already knows all about the borland compiler, so all we need to is to make it the default.
  3. The .lib files in the sybase open client lib directory are for microsoft C. Borland has provided a utility to convert these files into a format it can use. By trial and error I have found the command line options that work. start by copying the .lib files to .lib.old and then run the following commands:
     coff2omf -lib:st libblk.lib.old libblk.lib
     coff2omf -lib:st libcs.lib.old libcs.lib
     coff2omf -lib:st libct.lib.old libct.lib
     coff2omf -lib:st libsybdb.lib.old libsybdb.lib
  4. Now you can follow the instructions to included with the sybase module to install the software. Be forewarned that Borland will produce a boatload of warning messages. These messages do not seem to critical as I have not experienced any problems.