Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere Python Database support

 

Introduction to sqlanydb

The sqlanydb interface provides access to SQL Anywhere databases from scripts written in Python. The sqlanydb module implements, with extensions, the Python Database API specification v2.0 written by Marc-André Lemburg. Once you have installed the sqlanydb module, you can access and change the information in SQL Anywhere databases from Python.

For information about the Python Database API specification v2.0, visit [external link] Python Database API specification v2.0.

The sqlanydb module is thread-safe when using Python with threads.

Requirements

The sqlanydb module requires the following components.

  • Python 2.4 or newer (2.5 or newer is recommended).

  • The ctypes module is required. To test if the ctypes module is present, open a command prompt window and run Python.

    At the Python prompt, enter the following statement.

    import ctypes

    If you see an error message, then ctypes is not present. The following is an example.

    >>> import ctypes
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    ImportError: No module named ctypes

    If ctypes is not included in your Python installation, install it. Installs can be found in the SourceForge.net files section at [external link] http://sourceforge.net/project/showfiles.php?group_id=71702, or can be automatically downloaded and installed with Peak EasyInstall. To download Peak EasyInstall, visit [external link] http://peak.telecommunity.com/DevCenter/EasyInstall.

The following sections provide assistance with installing Python and the sqlanydb module.