cx_Oracle で次のクエリを実行しようとしていますが、実行中に次のエラーが発生します。
print 'Error.code =', error.code
AttributeError: 'str' object has no attribute 'code'
コード:
try:
conn.exec("Select * from table1")
except cx_Oracle.DatabaseError, ex:
error, = ex.args
print 'Error Inserting Field Base'
print 'Error.code =', error.code
print 'Error.message =', error.message
print 'Error.offset =', error.offset
conn.rollback()