![]() |
||
---|---|---|
.. | ||
sql | ||
tutorial | ||
README.md | ||
app_context.py | ||
aq_notification.py | ||
array_dml_rowcounts.py | ||
batch_errors.py | ||
bind_insert.py | ||
bind_query.py | ||
bulk_aq.py | ||
call_timeout.py | ||
connection_pool.py | ||
cqn.py | ||
cqn2.py | ||
database_change_notification.py | ||
database_shutdown.py | ||
database_startup.py | ||
dbms_output.py | ||
dml_returning_multiple_rows.py | ||
drcp.py | ||
drop_samples.py | ||
editioning.py | ||
generic_row_factory.py | ||
implicit_results.py | ||
insert_geometry.py | ||
json_blob.py | ||
json_direct.py | ||
last_rowid.py | ||
multi_consumer_aq.py | ||
object_aq.py | ||
plsql_collection.py | ||
plsql_function.py | ||
plsql_procedure.py | ||
plsql_record.py | ||
query.py | ||
query_arraysize.py | ||
query_strings_as_bytes.py | ||
raw_aq.py | ||
ref_cursor.py | ||
return_lobs_as_strings.py | ||
return_numbers_as_decimals.py | ||
rows_as_instance.py | ||
sample_env.py | ||
scrollable_cursors.py | ||
session_callback.py | ||
session_callback_plsql.py | ||
setup_samples.py | ||
sharding_number_key.py | ||
soda_basic.py | ||
soda_bulk_insert.py | ||
spatial_to_geopandas.py | ||
subclassing.py | ||
transaction_guard.py | ||
type_handlers.py | ||
universal_rowids.py |
README.md
Samples
News
cx_Oracle has a major new release under a new name and homepage python-oracledb.
New projects should install python-oracledb instead of cx_Oracle.
The new source code and samples can be found at github.com/oracle/python-oracledb.
cx_Oracle Examples
This directory contains samples for cx_Oracle. Documentation is here. A separate tutorial is here.
-
The schemas and SQL objects that are referenced in the samples can be created by running the Python script setup_samples.py. The script requires SYSDBA privileges and will prompt for these credentials as well as the names of the schemas and edition that will be created, unless a number of environment variables are set as documented in the Python script sample_env.py. Run the script using the following command:
python setup_samples.py
Alternatively, the SQL script can be run directly via SQL*Plus, which will always prompt for the names of the schemas and edition that will be created.
sqlplus sys/syspassword@hostname/servicename @sql/setup_samples.sql
-
Run a Python script, for example:
python query.py
-
After running cx_Oracle samples, the schemas and SQL objects can be dropped by running the Python script drop_samples.py. The script requires SYSDBA privileges and will prompt for these credentials as well as the names of the schemas and edition that will be dropped, unless a number of environment variables are set as documented in the Python script sample_env.py. Run the script using the following command:
python drop_samples.py
Alternatively, the SQL script can be run directly via SQL*Plus, which will always prompt for the names of the schemas and edition that will be dropped.
sqlplus sys/syspassword@hostname/servicename @sql/drop_samples.sql