[Zope] dcoracle

Adam Gotheridge adam@foxvalley.net
Wed, 29 Dec 1999 09:02:37 -0600


I can't find a single example how to use the dcoracle package and can't
figure it out. The documentation says:
Connect(connection_string)
Constructor for creating a connection to the database. Returns a Connection
Object.

This looks fine and returns a connection object  with
dbc = oci_.Connect('scott/tiger@thunder')

The docs describing connection object includes:
cursor()
Return a new Cursor Object. An exception may be thrown if the database does
not support a cursor concept.

I can't get this to work and don't know why. Code looks like:

#!/usr/bin/python
import sys
sys.path.append('/usr/local/zope/Zope-2.0.1-linux2-x86/lib/python/Products/Z
OracleDA/DCOracle')
import Buffer, oci_
dbc = oci_.Connect('scott/tiger@thunder')
cursor = dbc.cursor()

error returned is:
AttributeError: 'Connection' object has no attribute 'cursor'

Can anyone post a simple example of how to connect and return a recordset?

Thanks