python循环插入数据 oracle

python链接oracle,要安装cx_Oracle

代码:

#-*-coding=utf-8
import cx_Oracle
import math

Comn=cx_Oracle.Connection('system/wzh123456@192.168.0.40/orcl')

Cur=Comn.cursor()
for i in range(1, 100):
  Cur.execute("insert into business_reconciliation_tbl(id,merchant_name,settle_money,is_del,state,merchant_id) values('%s','%s','%s','%s','%s','%s')" %(i, "test01","100","0","0","EFB8B43400D549EA919431AA85FEE0E4"))
  Comn.commit()

Cur.close()
Comn.close()

posted on 2014-10-23 14:46  freedomdym  阅读(716)  评论(0编辑  收藏  举报

导航