推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
415829566
V2EX  ›  Python

python3 连接 oracle 数据库,批量插入数据报错

  •  
  •   415829566 · May 31, 2018 · 3161 views
    This topic created in 2940 days ago, the information mentioned may be changed or developed.
    如题:
    报了这个错误:TypeError: expecting integer

    但是单条插入没问题
    2 replies    2018-05-31 10:33:45 +08:00
    415829566
        1
    415829566  
    OP
       May 31, 2018
    附上代码:
    def insertOracleTable(self,table_name,datas=[]):
    self.conndb()
    #insert_sql="insert into "+table_name+" values(:1,:2,:3,:4,:5,:6,:7)"
    print(insert_sql)
    print(datas)
    self.cursor.prepare(insert_sql)
    self.cursor.executemany(None,datas)
    self.commitdb()
    self.closedb()
    415829566
        2
    415829566  
    OP
       May 31, 2018
    附上数据:
    [('数仓 1 节点', 'DW_TBL', 1214, 1136.97, 77.03, 93.65, datetime.datetime(2018, 5, 31, 10, 26, 42)), ('数仓 2 节点', 'TBS_DW_ODS_DAT', 154, 139.88, 14.12, 90.83, datetime.datetime(2018, 5, 31, 10, 26, 42))]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5577 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 03:16 · PVG 11:16 · LAX 20:16 · JFK 23:16
    ♥ Do have faith in what you're doing.