Python Forum
How do you format Update statement with multiple conditions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you format Update statement with multiple conditions
#3
Thank you.
I made just one tuple and i added the "and"' for separating the conditions as you suggested. It does not error-out like before but I can not seem to get the items in the tuple sequenced correctly to return what needs to be updated. Could you go a little bit further with what in the tuple matches up with what in the SET and WHERE using below-ie val1-?1, val2-?4 etc?

"UPDATE cowTbl SET A=?1, B=?2, C=?3 Where X=?4 and X=?5" ,(val1, val2, val3,val4,val5)
Reply


Messages In This Thread
RE: How do you format Update statement with multiple conditions - by hammer - Dec-16-2021, 02:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  An unexplainable error in .format statement - but only in a larger piece of code? ToniE 4 1,639 Sep-05-2023, 12:50 PM
Last Post: ToniE
Question Using SQLAlchemy, prevent SQLite3 table update by multiple program instances Calab 2 1,701 Aug-09-2023, 05:51 PM
Last Post: Calab
  String concatenation in SQL update statement hammer 3 2,609 Feb-24-2022, 08:00 PM
Last Post: hammer
  multiple condition if statement problem FelixReiter 3 3,466 Jan-11-2021, 08:07 AM
Last Post: FelixReiter
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 4,063 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  Multiple conditions when indexing an array with or without np.where noob2305 1 3,514 Oct-25-2020, 02:06 PM
Last Post: jefsummers
  Looking for help in Parse multiple XMLs and update key node values and generate Out.. rajesh3383 0 2,431 Sep-15-2020, 01:42 PM
Last Post: rajesh3383
  Multiple conditions, one is null moralear27 1 2,832 Sep-13-2020, 06:11 AM
Last Post: scidam
  MYSQL Update Query format simdo01 1 2,819 Aug-31-2020, 12:59 AM
Last Post: nilamo
  multiple number format conversion oli_action 4 3,545 Aug-11-2020, 05:10 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020