Title: 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
# File: testPyOra.py
# Purpose: Test Python/Oracle connectivity.
# Usage: ./testPyOra.py
#        Set the user connect info in myconstants.py
import myconstants as con
import cx_Oracle as db

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-----
From: Jamadagni, Rajendra [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 7:04 AM
To: Multiple recipients of list ORACLE-L
Subject: RE: Perl


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
______________________________________________________
Rajendra Jamadagni              MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is an art!


-----Original Message-----
From: Glenn Stauffer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 5:17 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: Perl


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.

Reply via email to