|
1 | 1 | # Samples
|
2 | 2 |
|
3 |
| -## News |
4 |
| - |
5 | 3 | **cx_Oracle has a major new release under a new name and homepage
|
6 |
| -[python-oracledb](https://oracle.github.io/python-oracledb/).** |
7 |
| - |
8 |
| -**New projects should install python-oracledb instead of cx_Oracle: python -m pip install oracledb** |
9 |
| - |
10 |
| -**The new source code and samples can be found at |
11 |
| -[github.com/oracle/python-oracledb](https://github.com/oracle/python-oracledb).** |
12 |
| - |
13 |
| -## cx_Oracle Examples |
14 |
| - |
15 |
| -This directory contains samples for [cx_Oracle][6]. Documentation is |
16 |
| -[here][7]. A separate tutorial is [here][8]. |
17 |
| - |
18 |
| -1. The schemas and SQL objects that are referenced in the samples can be |
19 |
| - created by running the Python script [setup_samples.py][1]. The script |
20 |
| - requires SYSDBA privileges and will prompt for these credentials as well as |
21 |
| - the names of the schemas and edition that will be created, unless a number |
22 |
| - of environment variables are set as documented in the Python script |
23 |
| - [sample_env.py][2]. Run the script using the following command: |
24 |
| - |
25 |
| - python setup_samples.py |
26 |
| - |
27 |
| - Alternatively, the [SQL script][3] can be run directly via SQL\*Plus, which |
28 |
| - will always prompt for the names of the schemas and edition that will be |
29 |
| - created. |
30 |
| - |
31 |
| - sqlplus sys/syspassword@hostname/servicename @sql/setup_samples.sql |
32 |
| - |
33 |
| -2. Run a Python script, for example: |
34 |
| - |
35 |
| - python query.py |
36 |
| - |
37 |
| -3. After running cx_Oracle samples, the schemas and SQL objects can be |
38 |
| - dropped by running the Python script [drop_samples.py][4]. The script |
39 |
| - requires SYSDBA privileges and will prompt for these credentials as well as |
40 |
| - the names of the schemas and edition that will be dropped, unless a number |
41 |
| - of environment variables are set as documented in the Python script |
42 |
| - [sample_env.py][2]. Run the script using the following command: |
43 |
| - |
44 |
| - python drop_samples.py |
| 4 | +[python-oracledb](https://oracle.github.io/python-oracledb/). New projects |
| 5 | +should use python-oracledb instead of the obsolete cx_Oracle driver.** |
45 | 6 |
|
46 |
| - Alternatively, the [SQL script][5] can be run directly via SQL\*Plus, which |
47 |
| - will always prompt for the names of the schemas and edition that will be |
48 |
| - dropped. |
| 7 | +Python-oracledb uses the same Python Database API as cx_Oracle, supports the |
| 8 | +feature requirements of frameworks that rely on this API, and has many new |
| 9 | +features. |
49 | 10 |
|
50 |
| - sqlplus sys/syspassword@hostname/servicename @sql/drop_samples.sql |
| 11 | +**Python-oracledb samples can be found at |
| 12 | +[github.com/oracle/python-oracledb/tree/main/samples](https://github.com/oracle/python-oracledb/tree/main/samples).** |
51 | 13 |
|
52 |
| -[1]: https://github.com/oracle/python-cx_Oracle/blob/main/samples/setup_samples.py |
53 |
| -[2]: https://github.com/oracle/python-cx_Oracle/blob/main/samples/sample_env.py |
54 |
| -[3]: https://github.com/oracle/python-cx_Oracle/blob/main/samples/sql/setup_samples.sql |
55 |
| -[4]: https://github.com/oracle/python-cx_Oracle/blob/main/samples/drop_samples.py |
56 |
| -[5]: https://github.com/oracle/python-cx_Oracle/blob/main/samples/sql/drop_samples.sql |
57 |
| -[6]: https://oracle.github.io/python-cx_Oracle/ |
58 |
| -[7]: http://cx-oracle.readthedocs.org/en/latest/index.html |
59 |
| -[8]: https://oracle.github.io/python-cx_Oracle/samples/tutorial/Python-and-Oracle-Database-Scripting-for-the-Future.html |
| 14 | +To upgrade to python-oracledb, see [Upgrading from cx_Oracle 8.3 to |
| 15 | +python-oracledb](https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_c.html#upgrading-from-cx-oracle-8-3-to-python-oracledb). |
0 commit comments