cx_Oracle /

Filename Size Date modified Message
11.0 KB
49.2 KB
69.6 KB
6.2 KB
8.3 KB
7.8 KB
5.0 KB
9.4 KB
23.4 KB
11.3 KB
32.9 KB
1.7 KB
13.2 KB
6.6 KB
196 B
20.4 KB
20.2 KB
8.5 KB
2.4 KB
18.3 KB
12.9 KB
8.2 KB
3.2 KB
41.4 KB
16.8 KB
11.3 KB

Open Source Python/Oracle Utility - cx_Oracle

cx_Oracle is a Python extension module that allows access to Oracle and conforms to the Python database API 2.0 specifications with a few exceptions.

See for more information on the Python database API specification.

For comments, contact Anthony Tuininga at or use the mailing list at

Please note that an Oracle client (or server) installation is required in order to use cx_Oracle. If you do not require the tools that come with a full client installation, it is recommended to install the Instant Client which is far easier to install.

BINARY INSTALL: Place the file cx_Oracle.pyd or anywhere on your Python path.

SOURCE INSTALL: This module has been built with Oracle 9.2.0, 10.2.0, 11.1.0 on Linux, Solaris and Windows. It will likely build on other platforms and other Oracle versions but I haven't tried them. Use the provided to build and install the module which makes use of the distutils module. Note that on Windows, I have used mingw32 ( and the module will not build with MSVC without modification. The commands required to build and install the module are as follows:

python build python install


import cx_Oracle

# connect via SQL*Net string or by each segment in a separate argument #connection = cx_Oracle.connect("user/password@TNS") connection = cx_Oracle.connect("user", "password", "TNS")

cursor = connection.cursor() cursor.arraysize = 50 cursor.execute("""

select Col1, Col2, Col3 from SomeTable where Col4 = :arg_1

and Col5 between :arg_2 and :arg_3""",

arg_1 = "VALUE", arg_2 = 5, arg_3 = 15)

for column_1, column_2, column_3 in cursor.fetchall():
print "Values:", column_1, column_2, column_3

For more examples, please see the test suite in the test directory and the samples in the samples directory. You can also look at the scripts in the cx_OracleTools ( and the modules in the cx_PyOracleLib ( projects.

EXCEPTIONS: The only exception to the DB API specification is the lack of a nextset() method which is not supported by Oracle.

Please see the included documentation for additional information.