[問題] cx_Oracle BLOB 寫入 資料庫
小弟遇到一個怪問題
使用cx_Oracle連接資料庫
conn = cx_Oracle.connect(os.getenv('ID'), os.getenv('PASSWORD'),
os.getenv('DBCONN_STR'))
cur = conn.cursor()
# production env
sql = ('insert into Tab ( \
FILENAME, WAFERLOT, SLOT, NAME,TXNTIME, \
WAFER, DBSCAN, PREDRESULT, \
CDT, PLANT, REMARK, STEPNAME, AOLOT, DIESIZE)'
'values (:filename, :waferlot, :slot, :name, :txntime, \
:wafer, :dbscan, :predresult, \
:cdt, :plant, :remark, :stepname, :aolot, :diesize)')
# map --> tuple
cur.executemany(sql, map)
conn.commit()
cur.close()
conn.close()
若是用spyder內去執行程式碼
將圖片寫入Oracle BLOB不會有任何問題
但在command line下去執行程式卻會報錯
也不是每筆資料都會有問題
懇請大家協助
cur.executemany(sql, map)
cx_Oracle.DatabaseError: ORA-24816: 在實際的 LONG 或 LOB 資料欄之後提供擴充的
非 LONG 連結資料
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.72.3.156 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1608100921.A.37D.html
→
12/16 14:43,
4年前
, 1F
12/16 14:43, 1F
Python 近期熱門文章
PTT數位生活區 即時熱門文章