私は、Python ロギング モジュールのハンドラーに取り組んでいます。これは基本的にOracleデータベースに記録されます。
私は cx_oracle を使用していますが、取得方法がわからないのは、テーブルが空の場合の列の値です。
cursor.execute('select * from FOO')
for row in cursor:
# this is never executed because cursor has no rows
print '%s\n' % row.description
# This prints none
row = cursor.fetchone()
print str(row)
row = cursor.fetchvars
# prints useful info
for each in row:
print each
出力は次のとおりです。
None
<cx_Oracle.DATETIME with value [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None
, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None
, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]>
<cx_Oracle.STRING with value [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]>
var データを見ると、データ型とそのサイズ (count nones?) を確認できますが、列名がありません。
これについてどうすればいいですか?