Using DCOracle

Bill Scherer scherbi at bam.com
Tue May 23 08:56:59 EDT 2000


Luca -

Something is not right.  A valid db connection can definitely return a
cursor with the code Oleg showed you.
Here is a simple interactive session:

>>> import DCOracle
>>> db = DCOracle.Connect("%s/%s@%s" % (uid, passwd, host))
>>> print db
<DCOracle.ocidb.ocidb instance at 811d3d8>
>>> cursor = db.cursor()
>>> print cursor
<DCOracle.ociCurs.Cursor instance at 815d860>
>>> cursor.execute("select 2*2 from dual")
>>> cursor.fetchall()
[(4,)]
>>> cursor.close()
>>> db.close()
>>>

If you do "print dbc" does it look like the output of "print db" above?

Luca wrote:

> Oleg Broytmann wrote:
>
> >    cur = dbc.cursor()
>
> Doesn't work and the error is:
>
> Traceback (innermost last):
>   File ".//prova.py", line 11, in ?
>     cur = dbc.cursor()
> AttributeError: 'Connection' object has no attribute 'cursor'
>
> But the rest of the code of my original message is right?
>
> Where can I find a simple python script that use DCOracle?
>
> Thanks.
> --
> http://www.python.org/mailman/listinfo/python-list

--
William K. Scherer
Sr. Member of Applications Staff
Verizon Wireless







More information about the Python-list mailing list