以下查询工作正常(通过字典传递值)
cursor.execute("""insert into MDP_ERR_MASTER (MARKERID, FILENAME, ERRORCODE, USERID, CHECKEDBY, CHECKEDDT, STATUS, COMMENTS, X1, Y1, Z1, X2, Y2, Z2, RECNO, PROJECT_CODE, SRC_ACC_NUM, WORKAREA, CONFIGID, ELEMENTID)
values (:markerid,:shapename,:errcode,'0',:sysid,sysdate,'OPEN',:usercomment,:x1,:y1,0,:x2,:y2,0,1,:jobno,:srcacnum,chr(182) || :workarea || chr(182),0,0)""",
{"markerid" : markerId,
"shapename" : str(errorMarkerLayer.name()),
"errcode" : errCode ,
"sysid" : self.sysid ,
"usercomment" : str(comments),
"x1" : startPnt[0],
"y1" : startPnt[1],
"x2" : endPnt[0],
"y2" : endPnt[1],
"jobno" : self.jobNo,
"srcacnum" : src_AcNum,
"workarea" : self.wrkArea
})
但是下面通过列表传递值不起作用'Variable_TypeByValue():未处理的数据类型元组'
cursor.execute("""insert into MDP_ERR_MASTER (MARKERID, FILENAME, ERRORCODE, USERID, CHECKEDBY, CHECKEDDT, STATUS, COMMENTS, X1, Y1, Z1, X2, Y2, Z2, RECNO, PROJECT_CODE, SRC_ACC_NUM, WORKAREA, CONFIGID, ELEMENTID)
values (:1,:2,:3,'0',:4,sysdate,'OPEN',:5,:6,:7,0,:8,:9,0,1,:10,:11,chr(182) || :12 || chr(182),0,0)""",
[(1 , markerId),
(2 , str(errorMarkerLayer.name())),
(3 , errCode),
(4 , self.sysid),
(5 , str(comments)),
(6 , startPnt[0]),
(7, startPnt[1]),
(8 , endPnt[0]),
(9, endPnt[1]),
(10 , self.jobNo),
(11 , src_AcNum),
(12 , self.wrkArea)
])