美文网首页
NotSupportedError: Python value

NotSupportedError: Python value

作者: 庞贝船长 | 来源:发表于2019-03-08 09:35 被阅读0次

解决方法

cx_Oracle 版本 < 7.1

  1. perform all inserts in a single batch (but depending on size this might not be usable)
  2. create a new cursor for each batch (so that cx_Oracle calculates the types for each batch)
  3. use cursor.setinputsizes() to specify the types and sizes (may be cumbersome)
db_types = (d[1] for d in cursor_select.description)
cursor_insert.setinputsizes(*db_types)

cx_Oracle 版本 >= 7.1

该 bug 已被修复。
但又会有新的 bug:

 "DPI-1044: value cannot be represented as an Oracle number", // DPI_ERR_NUMBER_NO_REPR

暂且没找到解决方法,那还是用旧版的先吧。。

参考

相关文章

网友评论

      本文标题:NotSupportedError: Python value

      本文链接:https://www.haomeiwen.com/subject/kaylpqtx.html