Below shows a workableUpdate format for changing 1 field with 1 Where condition. I understand how the Bobby Table Format association works here.
What would the Format look like with multiple field changes and multiple conditions?
def update_cowTbl(self,tagNoC,tagClrC,tagYrC,tagNoV,tagClrV,tagYrV):
self.c.execute("UPDATE cowTbl SET tagNo=? WHERE tagNo=?",(tagNoV,tagNoC))
self.con.commit()
What does not work: ("UPDATE cowTbl SET tagNo=?,tagClr=? WHERE tagNo=?,tagClr=?",(tagNoV,tagNoC),(tagClrV,tagClrC))
What would the Format look like with multiple field changes and multiple conditions?
def update_cowTbl(self,tagNoC,tagClrC,tagYrC,tagNoV,tagClrV,tagYrV):
self.c.execute("UPDATE cowTbl SET tagNo=? WHERE tagNo=?",(tagNoV,tagNoC))
self.con.commit()
What does not work: ("UPDATE cowTbl SET tagNo=?,tagClr=? WHERE tagNo=?,tagClr=?",(tagNoV,tagNoC),(tagClrV,tagClrC))
Larz60+ write Dec-16-2021, 04:42 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please use bbcode tags, it's a forum rule.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please use bbcode tags, it's a forum rule.