cx_oracle 插入多条记录

bigzhu posted @ Jul 27, 2010 10:08:00 AM in cx_oracle , 2610 阅读

使用executemany()

多条插入
INTO TEST (NAME, ID) VALUES ('Mike', 1);
INSERT INTO TEST (NAME, ID) VALUES ('Matt', 2);
这样来
cursor.executemany("INSERT INTO TEST (NAME, ID) VALUES(:1, :2)", [{'1': 'Mike', '2':1}, {'1': 'Matt', '2':2}])



登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter