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: Perl

RE: Perl

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Wed, 29 Jan 2003 09:20:06 -0800
Message-ID: <F001.0053D737.20030129092006@fatcity.com>


Thanks a bunch ...  

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-----
Sent: Wednesday, January 29, 2003 10:14 AM To: Multiple recipients of list ORACLE-L

There are two resources:

http://www.zope.org/Members/matt/dco2

<http://www.zope.org/Members/matt/dco2>
http://www.computronix.com/utilities.shtml

<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-----
<mailto:Rajendra.Jamadagni_at_espn.com> ]

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



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-----
<mailto:stauffer_at_swarthmore.edu> ]

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: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.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 - 11:20:06 CST

Original text of this message

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