Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Perl
There are two resources:
http://www.zope.org/Members/matt/dco2
http://www.computronix.com/utilities.shtml
The installs are not as nice as DBI but the products work. We've been using cx_Oracle in production for over a year now and have no complaints. Here's an Oracle connectivity test script:
#!/usr/bin/env python
def doConnect():
theUser = con.defuser
thePW = con.defpw
theConnectString = con.defcs
conn=db.connect(theUser,thePW,theConnectString)
if conn != None :
theText = "Successfully connected to Oracle!" else:
theText = "Unable to connect to the database."
print theText
return conn
def doQuery(myConn):
if myConn != None :
print "Since we have a valid connection I'll do a query to prove it..."
print "Here's a list of users on this database..." SQLtext = "Select username from dba_users" cursor = myConn.cursor() cursor.execute(SQLtext) resultSet = cursor.fetchall() for un in resultSet: print "%s" %un else : print "Since we're not connected I won't even bother doing a query."
def main():
theConn = doConnect()
doQuery(theConn)
if __name__=='__main__':main()
Steve
-----Original Message-----
Sent: Wednesday, January 29, 2003 7:04 AM
To: Multiple recipients of list ORACLE-L
Okay ... a question from a colleague ...
How do you get python to work with Oracle ... for perl there DBD: and DBI:
anything similar in Python? My knowledge of Perl is as good as my knowledge
of Python ... /dev/null
Raj
QOTD: Any clod can have facts, but having an opinion is an art!
-----Original Message-----
Sent: Tuesday, January 28, 2003 5:17 PM
To: Multiple recipients of list ORACLE-L
I tinkered with Perl, but could never really get used to the syntax. I basically gave up (still maintain familiarity since Perl is very common) and started using Python. I've grown to enjoy coding in Python and use it now for all of the system maintenance and monitoring scripts I write as well as for my web programming work. I'm not qualified to compare the two languages, but I will say that Perl's Oracle support is better developed and the CPAN archives are a very useful thing. In my opinion, Python is a better designed language and it is perfectly viable for production-level applications in an Oracle environment.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Orr, Steve INET: sorr_at_rightnow.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Jan 29 2003 - 09:13:49 CST
![]() |
![]() |