连接数据库时报错
1. ORA-24315: 非法的属性类型
2.python
ImportError: DLL load failed: %1 不是有效的 Win32 应用程
原因:Oracle客户端与cx_Oracle版本不一致
查询Oracle客户端版本:sqlplus -v
--SQL*Plus: Release10.2.0.1.0 - Production
cx_Oracle-5.1.2-10g.win32-py2.7.msi(10g.win32为客户端的版本号,py2.7为python的版本号)
如果客户端装的是32位,则cx_Oracle也必须是32位
测试脚本oracleConnect.py
import cx_Oracle
conn = cx_Oracle.connect('username/password@domain/sid')
cursor = conn.cursor ()
cursor.execute ("select * from dual")
row = cursor.fetchone ()
print row[0]
cursor.close ()
conn.close ()