README.txt 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 9.2.0, 10.2.0, 11.1.0 on Linux,
  23. Solaris and Windows. Others have reported success with other platforms
  24. such as Mac OS X.
  25. Use the provided setup.py to build and install the module which makes use of
  26. the distutils module. Note that on Windows, I have used mingw32
  27. (http://www.mingw.org) and the module will not build with MSVC without
  28. modification. The commands required to build and install the module are as
  29. follows:
  30. python setup.py build
  31. python setup.py install
  32. See BUILD.txt for additional information.
  33. Usage Example
  34. -------------
  35. import cx_Oracle
  36. # connect via SQL*Net string or by each segment in a separate argument
  37. #connection = cx_Oracle.connect("user/password@TNS")
  38. connection = cx_Oracle.connect("user", "password", "TNS")
  39. cursor = connection.cursor()
  40. cursor.execute("""
  41. select Col1, Col2, Col3
  42. from SomeTable
  43. where Col4 = :arg_1
  44. and Col5 between :arg_2 and :arg_3""",
  45. arg_1 = "VALUE",
  46. arg_2 = 5,
  47. arg_3 = 15)
  48. for column_1, column_2, column_3 in cursor:
  49. print "Values:", column_1, column_2, column_3
  50. For more examples, please see the test suite in the test directory and the
  51. samples in the samples directory. You can also look at the scripts in the
  52. cx_OracleTools (http://cx-oracletools.sourceforge.net) and the modules in the
  53. cx_PyOracleLib (http://cx-pyoraclelib.sourceforge.net) projects.