Python
Prev | Chapter 7. How to get what works with it working | Next

## Python

### pymssql

The pymssql module is a simple database interface to Microsoft SQL Server for Python that builds on top of FreeTDS to provide a Python DB-API v2 (PEP-249) interface to Microsoft SQL Server.

The 2.x branch of pymssql take advantage of recent releases (0.91 and newer) of FreeTDS and by doing that removes many of the limitations previously found with older FreeTDS versions and the 1.x branch.

pymssql features include:

- Unicode friendly

- Python 3 friendly

- Works on most popular operating systems

- Written in Cython for performance

- Includes a supported and documented low-level module (`_mssql`) that you can use instead of the DB-API

- Supports stored procedures with both return values and output parameters

- A comprehensive test suite

Please refer to the pymssql home page where you'll find complete documentation on how to obtain, install and use it.

### Sybase module

You can obtain the Python Sybase module here. This example uses version 0.37, the most current at the time of this writing, please adjust accordingly if using a different version.

    	$ tar xvfz sybase-0.37.tgz
    	$ cd sybase-0.37
    	$ export SYBASE=/usr/local/freetds
    	$ export CFLAGS="-DHAVE_FREETDS"
    	$ export LD_LIBRARY_PATH=/usr/local/freetds/lib:${LD_LIBRARY_PATH}
    	$ python setup.py install

Edit the example.py and fix the bottom stuff, FreeTDS lacks the 110 symbols for version use 100

    	$ python example.py

Prev | Up | Next
PHP | Home | Qt