Python embebbed with Oracle SQL*Plus

Tom Bryan tbryan at python.net
Sat Jul 21 22:02:31 EDT 2001


Olav wrote:

> Some time ago I did some Oracle SQL*Plus on UNIX,
> and I was able to write quite powerful scripts
> embebbed in ksh (Korn Shell).
> 
> Is something similar possible with Python?

Yes, as others have stated, you can probably do something 
similar with sqlplus and the popen functions.

> Also I have seen that that there is a special Perl
> version for Oracle.  Is there something similar for
> Python (and would it be necessary to make a special
> Python for this?).

I can recommend DCOracle.  You won't need to make a special 
Python, but you will need to install an extension module (which 
may include compiling it from sources).

If you're using Jython, I've heard that you can also use Java's JDBC, 
but I've never tried it.
 
> Generally, what is the best way to script Oracle with
> Python, and how does it compare to the two above?

I'd say DCOracle is the way to go.  At least give it a try.
http://www.zope.org/Products/DCOracle/
http://www.zope.org/Members/matt/dco2

See also 
http://www.python.org/sigs/db-sig/
http://www.python.org/topics/database/

more-fun-than-a-terabyte-of-data-ly yours
---Tom




More information about the Python-list mailing list