@@ -4,35 +4,41 @@ cx_Oracle is a Python extension module that enables access to Oracle Database.
4
4
It conforms to the [ Python database API 2.0 specification] [ 1 ] with a
5
5
considerable number of additions and a couple of exclusions.
6
6
7
- cx_Oracle is licensed under a [ BSD license] which you can find [ here] [ 3 ] .
7
+ cx_Oracle is licensed under a BSD license which you can find [ here] [ 3 ] .
8
8
9
- cx_Oracle 6 has been tested with Python version 2.7, and with versions 3.4 and
10
- higher. You can use cx_Oracle with Oracle 11.2, 12.1 and 12.2 client libraries,
11
- allowing connection to multiple Oracle Database versions . Oracle's standard
12
- client-server version interoperability allows connection to both older and
13
- newer databases, for example Oracle 12.2 client libraries can connect to Oracle
9
+ cx_Oracle 6 has been tested with Python version 2.7, and with versions
10
+ 3.4 and higher. You can use cx_Oracle with Oracle 11.2, 12.1 and 12.2
11
+ client libraries . Oracle's standard client-server version
12
+ interoperability allows connection to both older and newer databases,
13
+ for example Oracle 12.2 client libraries can connect to Oracle
14
14
Database 11.2 or later.
15
15
16
+ ## Documentation
17
+
18
+ See the [ cx_Oracle Documentation] [ 2 ] and [ Release Notes] [ 14 ] .
19
+
16
20
## Help
17
21
18
22
Issues and questions can be raised with the cx_Oracle community on
19
23
[ GitHub] [ 9 ] or on the [ mailing list] [ 5 ] .
20
24
21
- ## Documentation
22
-
23
- See the [ cx_Oracle Documentation] [ 2 ] and [ Release Notes] [ 14 ] .
24
-
25
25
## Installation
26
26
27
27
See [ cx_Oracle Installation] [ 15 ] for detailed instructions.
28
28
29
- - The simplest way to install cx_Oracle 6 RC2 is with pip:
29
+ - The simplest way to install cx_Oracle 6 is with pip:
30
30
31
- ` python -m pip install cx_Oracle --pre `
31
+ ```
32
+ python -m pip install cx_Oracle --upgrade
33
+ ```
32
34
33
35
If a binary wheel package is not available on [ PyPI] [ 6 ] for your platform, the
34
36
source package will be used.
35
37
38
+ Note that if you download a source zip file directly from GitHub
39
+ that you will also need to download an [ ODPI-C] [ 10 ] source zip file
40
+ and extract it inside the directory called "odpi".
41
+
36
42
- After cx_Oracle is installed, Oracle client libraries must also be installed
37
43
and configured. These can be from Oracle Instant Client, from a local Oracle
38
44
Database, or from a full Oracle Client installation.
@@ -42,44 +48,40 @@ See [cx_Oracle Installation][15] for detailed instructions.
42
48
platform-specific library path loading environment. See
43
49
the [ installation notes for ODPI-C] [ 13 ] for help.
44
50
45
- Versions 11.2, 12.1 and 12.2 of the Oracle Client libraries on Linux,
46
- Windows and macOS are supported. Users have also reported success
47
- with other platforms.
48
-
49
- Note that if you download a source zip file directly from GitHub that
50
- you will also need to download an [ ODPI-C] [ 10 ] source zip file and
51
- extract it inside the directory called "odpi".
51
+ Versions 11.2, 12.1 and 12.2 of the Oracle Client libraries on Linux,
52
+ Windows and macOS are supported. Users have also reported success
53
+ with other platforms.
52
54
55
+ If you require cx_Oracle 5.3, download a Windows installer from
56
+ [ PyPI] [ 16 ] or use ` python -m pip install cx-oracle==5.3 ` to
57
+ install from source.
53
58
54
- ## Usage Example
59
+ Very old versions of cx_Oracle can be found in the files section at
60
+ [ SourceForce] [ 17 ] .
55
61
62
+ ## Example
56
63
57
64
``` python
58
- from __future__ import print_function # needed for Python 2.x
65
+ from __future__ import print_function
59
66
60
67
import cx_Oracle
61
68
62
- # connect via SQL*Net string or by each segment in a separate argument
63
- # connection = cx_Oracle.connect("user/password@TNS")
64
- connection = cx_Oracle.connect(" user" , " password" , " TNS" )
69
+ connection = cx_Oracle.connect(" hr" , " welcome" , " localhost/orclpdb" )
65
70
66
71
cursor = connection.cursor()
67
72
cursor.execute("""
68
- select Col1, Col2, Col3
69
- from SomeTable
70
- where Col4 = :arg_1
71
- and Col5 between :arg_2 and :arg_3""" ,
72
- arg_1 = " VALUE" ,
73
- arg_2 = 5 ,
74
- arg_3 = 15 )
75
- for column_1, column_2, column_3 in cursor:
76
- print (" Values:" , column_1, column_2, column_3)
73
+ SELECT first_name, last_name
74
+ FROM employees
75
+ WHERE department_id = :did AND employee_id > :eid""" ,
76
+ did = 50 ,
77
+ eid = 190 )
78
+ for fname, lname in cursor:
79
+ print (" Values:" , fname, lname)
77
80
```
78
81
79
-
80
82
For more examples, please see the [ test suite] [ 11 ] and the
81
- [ samples] [ 12 ] . You can also look at the scripts in the [ cx_OracleTools] [ 7 ] and
82
- the modules in the [ cx_PyOracleLib] [ 8 ] projects .
83
+ [ samples] [ 12 ] . You can also look at the scripts in [ cx_OracleTools] [ 7 ] and
84
+ the modules in [ cx_PyOracleLib] [ 8 ] .
83
85
84
86
## Features
85
87
@@ -94,15 +96,10 @@ the modules in the [cx_PyOracleLib][8] projects.
94
96
- Connect to Oracle Database 9.2, 10, 11 or 12 (depending on the
95
97
Oracle Client version used).
96
98
97
- - SQL and PL/SQL Execution, with full support for OCI features like
98
- statement caching and statement caching auto-tuning. Oracle OCI
99
- (which is the database access layer used by cx_Oracle) has
100
- significant optimizations, including compressed fetch, pre-fetching,
101
- client and server result set caching, and statement caching.
102
- cx_Oracle applications can additionally make full use of PL/SQL to
103
- keep business logic near the data in the database, where it can be
104
- processed without having to ship large volumes of data to the
105
- application.
99
+ - SQL and PL/SQL Execution. The underlying Oracle Client libraries
100
+ have significant optimizations including compressed fetch,
101
+ pre-fetching, client and server result set caching, and statement
102
+ caching with auto-tuning.
106
103
107
104
- Full use of Oracle Network Service infrastructure, including
108
105
encrypted network traffic and security features.
@@ -182,3 +179,5 @@ for more information.
182
179
[ 13 ] : https://oracle.github.io/odpi/doc/installation.html
183
180
[ 14 ] : http://cx-oracle.readthedocs.io/en/latest/releasenotes.html
184
181
[ 15 ] : http://cx-oracle.readthedocs.io/en/latest/installation.html
182
+ [ 16 ] : https://pypi.python.org/pypi/cx_Oracle/5.3
183
+ [ 17 ] : https://sourceforge.net/projects/cx-oracle/files/
0 commit comments