RE: Java vs. Perl ... vs. Python

  • From: Branimir Petrovic <BranimirP@xxxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 2 Apr 2004 16:15:46 -0500

> 
> Branimir, please what do you use to connect phyton to Oracle,
> here I found but there are several choices.
> http://www.python.org/topics/database/modules.html
> 

The one listed as:

"cx_Oracle       Another Oracle interface"
(same as http://starship.python.net/crew/atuining/cx_Oracle/index.html)

Works like a charm, "comes" with mailing list support:
http://lists.sourceforge.net/lists/listinfo/cx-oracle-users


Example:

# FileName      OraTest1.py

import cx_Oracle

connection = cx_Oracle.connect("sys", "syspassword", "SID",
cx_Oracle.SYSDBA)
cursor = connection.cursor()
cursor.arraysize = 128

sqlStat ="""
select name, status, bytes/(1024 * 1024) from v$datafile
 order by name
"""

print sqlStat

cursor.execute(sqlStat)

for item in cursor.fetchall():
    print item
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: