Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Java vs. Perl ... vs. Python

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

From: Branimir Petrovic <BranimirP_at_cpas.com>
Date: Fri, 2 Apr 2004 16:15:46 -0500
Message-ID: <33678E78A2DD4D418396703A750048D45E6B3B@RIKER>


>
> 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_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Apr 02 2004 - 15:12:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US