问题:
cursor.execute()方法传递多个参数时,传参错误,错误传递方式如下:
sql = "insert into ent_portal.ent_stu_round(ord_id,ord_detail_id,round_id,status,property,isHistory,create_user_id,operator_id,delete_flag) values(%s,%s,%s,1,'SRP_ADDITIONAL',0,'hgf','hgf',0)"
self.cursor.execute(sql,parms,parms1,parms2)
解决办法:
多个参数需要放在元组里面,使用cursor.execute(sql, (parms,parms1,parms2))的形式
sql = "insert into ent_portal.ent_stu_round(ord_id,ord_detail_id,round_id,status,property,isHistory,create_user_id,operator_id,delete_flag) values(%s,%s,%s,1,'SRP_ADDITIONAL',0,'hgf','hgf',0)"
self.cursor.execute(sql, (parms,parms1,parms2))
标签:execute,TypeError,ent,sql,hgf,报错,ord,id
From: https://blog.csdn.net/hgfzero/article/details/137456681