win32 and Oracle

Gerhard Häring gerhard.haering at opus-gmbh.net
Thu Dec 12 12:43:17 EST 2002


Thomas Guettler <zopestoller at thomas-guettler.de> wrote:
> I need to access an oracle7 database from win32.
> 
> I found the following solutions:
> 
> - DCOracle (no binaries for win32)

I've built them for my current project.

Unfortunately, I currently don't have web space on which to put this. I'll
just email you the distutils installer.

Oh yeah. DCOracle doesn't have a setup.py for distutils. So instead of
fighting the Makefiles to build against Oracle 8.1.7, I just wrote one. For
future reference, here it is:

#v+
# distutils setup.py file for DCOracle
# set the ORACLE_HOME environment variable, then build it
#
# written by Gerhard Häring <gerhard.haering at opus-gmbh.net>

import os, os.path
from distutils.core import setup
from distutils.extension import Extension

__version__ = "1.3.2"

ora_home = os.getenv("ORACLE_HOME", r"c:\oracle\ora81")

setup (
    name = "DCOracle",
    version = __version__,
    description = \
        "DCOracle - A Python interface for Oracle 7 and up",
    url = "http://pypgsql.sourceforge.net/",
    licence = "BSD-like",
    packages = ["DCOracle"],
    ext_modules = [Extension(
        name="Buffer",
        sources = ["src/Buffer.c"]
        ),
        Extension(
        name="oci_",
        sources = ["src/oci_.c"],
        include_dirs = [os.path.join(ora_home, x) for x in ["oci/include"]],
        library_dirs = [os.path.join(ora_home, x) for x in ["oci/lib/msvc"]],
        libraries = ["oci"]
        )
        ]
)
#v-


HTH,
-- 
Gerhard Häring
OPUS GmbH München
Tel.: +49 89 - 889 49 7 - 32
http://www.opus-gmbh.net/



More information about the Python-list mailing list