ODBC

L

lblr33

I would like to connect to an Oracle database. In python version 2.1 I
used the following code and it worked fine. When I run the code in
version 2.4 it says that the odbc moduled does not exist. How do you
connect to an Oracle database in v2.4?

oradb=odbc.odbc('oracle/scott/tiger')
stmt='select project_id from s_projects'
cur=oradb.cursor()
cur.execute(stmt)
for rec in cur.fetchall():
print rec[0]
cur.close()

Thanks
 
R

Roger Upole

From the syntax, this appears to be the odbc module included
with the Pywin32 package.
http://sourceforge.net/projects/pywin32/
You probably have it installed with the 2.1.1 version, but
not 2.4.

hth
Roger

I would like to connect to an Oracle database. In python version 2.1 I
used the following code and it worked fine. When I run the code in
version 2.4 it says that the odbc moduled does not exist. How do you
connect to an Oracle database in v2.4?

oradb=odbc.odbc('oracle/scott/tiger')
stmt='select project_id from s_projects'
cur=oradb.cursor()
cur.execute(stmt)
for rec in cur.fetchall():
print rec[0]
cur.close()

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top