Python插数据入Oracle数据库的问题
这是错误的SQL
insert into ml_sadmpa_spc_apply_ltmp values (1026942869114, 'C441902VEH17003632', ' ', ' ', '5010800', '东莞分公司', 'GCZ064',
'蓝玲', '费用理赔申请', "to_date('2017-08-31 16:10:37','yyyy-mm-dd hh24:mi:ss')",
' ', ' ', ' ', ' ', 'null', 'null', ' ', ' ', ' ', '5010800', '08', '2017',
"to_date('2017-09-02 19:00:01','yyyy-mm-dd hh24:mi:ss')")
这是能插入的SQL
insert into ml_sadmpa_spc_apply_ltmp values (1026942869114, 'C441902VEH17003632', ' ', ' ', '5010800', '东莞分公司', 'GCZ064',
'蓝玲', '费用理赔申请', to_date('2017-08-31 16:10:37','yyyy-mm-dd hh24:mi:ss'),
' ', ' ', ' ', ' ', null, null, ' ', ' ', ' ', '5010800', '08', '2017',
to_date('2017-09-02 19:00:01','yyyy-mm-dd hh24:mi:ss'))
这是主要的代码
stmt = """INSERT INTO ml_sadmpa_spc_apply_ltmp (topactualid, notificationno, ctpclaimno, comclaimno, op_branch_code,
op_branch_name, op_code, op_name, kind, statrt_time, audit_code,
audit_name, audit_descript, the_result, special_start_time, back_time,
back_reason, isreopenctp, isreopencommercial, branch_code, ml_month,
ml_year, ml_population_timestamp) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,
:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23)"""
conn = cx_Oracle.connect('###', '####', '####')
cur = conn.cursor()
cur.executemany(stmt, params)
怎么才能让他生成正确的SQL啊 ,params打印的是错误的那种的
[(1026942869114, 'C441902VEH17003632', ' ', ' ', '5010800', '东莞分公司', 'GCZ064', '蓝玲', '费用理赔申请', "to_date('2017-08-31 16:10:37','yyyy-mm-dd hh24:mi:ss')", ' ', ' ', ' ', ' ', 'null', 'null', ' ', ' ', ' ', '5010800', '08', '2017', "to_date('2017-09-02 19:00:01','yyyy-mm-dd hh24:mi:ss')")]