README.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Open Source Python/Oracle Utility - cx_Oracle
  2. ---------------------------------------------
  3. cx_Oracle is a Python extension module that allows access to Oracle and
  4. conforms to the Python database API 2.0 specifications with a number of
  5. additions. The method cursor.nextset() and the time data type are not
  6. supported by Oracle and are therefore not implemented.
  7. See http://www.python.org/topics/database/DatabaseAPI-2.0.html for more
  8. information on the Python database API specification. See the included
  9. documentation for additional information.
  10. For feedback or patches, contact Anthony Tuininga at
  11. anthony.tuininga@gmail.com. For help or to ask questions, please use the
  12. mailing list at http://lists.sourceforge.net/lists/listinfo/cx-oracle-users.
  13. Please note that an Oracle client (or server) installation is required in order
  14. to use cx_Oracle. If you do not require the tools that come with a full client
  15. installation, it is recommended to install the Instant Client which is far
  16. easier to install.
  17. Binary Install
  18. --------------
  19. Place the file cx_Oracle.pyd or cx_Oracle.so anywhere on your Python path.
  20. Source Install
  21. --------------
  22. This module has been built with Oracle 10g, 11g and 12c on Linux and Windows.
  23. Others have reported success with other platforms such as Mac OS X.
  24. For simplified installation use pip
  25. pip install cx_Oracle
  26. Otherwise, you can use the provided setup.py to build and install the module
  27. python setup.py build
  28. python setup.py install
  29. See BUILD.txt for additional information.
  30. Usage Example
  31. -------------
  32. import cx_Oracle
  33. # connect via SQL*Net string or by each segment in a separate argument
  34. #connection = cx_Oracle.connect("user/password@TNS")
  35. connection = cx_Oracle.connect("user", "password", "TNS")
  36. cursor = connection.cursor()
  37. cursor.execute("""
  38. select Col1, Col2, Col3
  39. from SomeTable
  40. where Col4 = :arg_1
  41. and Col5 between :arg_2 and :arg_3""",
  42. arg_1 = "VALUE",
  43. arg_2 = 5,
  44. arg_3 = 15)
  45. for column_1, column_2, column_3 in cursor:
  46. print "Values:", column_1, column_2, column_3
  47. For more examples, please see the test suite in the test directory and the
  48. samples in the samples directory. You can also look at the scripts in the
  49. cx_OracleTools (http://cx-oracletools.sourceforge.net) and the modules in the
  50. cx_PyOracleLib (http://cx-pyoraclelib.sourceforge.net) projects.
  51. For further information see
  52. http://cx_oracle.readthedocs.org