我尝试编写一个.py脚本用于Oracle连接:
#!/usr/bin/python
import cx_Oracle
connstr='username/pwd@database'
conn = cx_Oracle.connect(connstr)
curs = conn.cursor()
curs.execute('select * from table1;')
print curs.description
for row in curs:
print row
conn.close()
我遇到了以下错误:
Traceback (most recent call last):
File "test_SQLPython.py", line 3, in ?
import cx_Oracle
ImportError: No module named cx_Oracle
有任何帮助将不胜感激。谢谢。