Accessing Oracle width Python
Thomas A. Bryan
tbryan at python.net
Wed Nov 1 06:56:21 EST 2000
Nuno Goncalves wrote:
>
> Hi there ! I'm trying to access an Oracle database with python !
>
> when i do a connect all goes ok:
> ---------------------------------------
> import Buffer, oci_, sys
>
> def escreve():
> print "Connecting..."
> dbc=oci_.Connect("string")
> --------------------------------
>
> But when i do a close it gives me the following error:
> dbc.close()
>
> close unknow attribute
>
> isn't a method ???
Are you using DCOracle? If so, you aren't supposed to import oci_.
Import DCOracle instead. I think that you should be doing something
like this. oci_ is used by DCOracle to implement the package, but
you normally don't call it directly from your program.
import Buffer, DCOracle, sys
def escreve():
print "Connecting..."
dbc = DCOracle.Connect("connection/string at database")
---Tom
More information about the Python-list
mailing list