Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
try / exceptionブロックで、Oracleエラー番号を抽出するにはどうすればよいですか?
try: cursor.execute("select 1 / 0 from dual") except cx_Oracle.DatabaseError, e: error, = e print "Code:", error.code print "Message:", error.message
これにより、次の出力が得られます。
Code: 1476 Message: ORA-01476: divisor is equal to zero