Python Forum
String concatenation in SQL update statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String concatenation in SQL update statement
#1
In the following Update statement i get shown Exception. Below are the arguments.
Could it be the parentheses around argg that is causing issue?
If so, i have tried .strip() without success.

fldSet: 'loc=?,aquired=?,disposition=?'
criteria: 'tagNo=? and tagClr=? and tagYr=?'
argg: 'Hermas,Purchased,Died,22,Red,2014'


 def global_cowUpDte(self,fldSet,criteria,argg):
        self.c.execute (f'UPDATE cowTbl SET {fldSet} WHERE {criteria}',(argg))

Exception has occurred: ProgrammingError
Incorrect number of bindings supplied. The current statement uses 6, and there are 35 supplied.
Exception has occurred:
Reply


Messages In This Thread
String concatenation in SQL update statement - by hammer - Feb-24-2022, 03:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries sawtooth500 14 713 Apr-24-2024, 01:42 AM
Last Post: sawtooth500
  FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries i sawtooth500 3 1,602 Mar-22-2024, 03:08 AM
Last Post: deanhystad
  Trying to compare string values in an if statement israelsattleen 1 586 Jul-08-2023, 03:49 PM
Last Post: deanhystad
  How do you format Update statement with multiple conditions hammer 4 2,161 Dec-16-2021, 10:49 PM
Last Post: hammer
  if statement string match javiopro 2 1,677 Sep-04-2021, 05:56 PM
Last Post: javiopro
  f string concatenation problem growSeb 3 2,306 Jun-28-2021, 05:00 AM
Last Post: buran
  Update Date based on Time/String stevezemlicka 1 2,051 Jan-08-2021, 06:54 PM
Last Post: Gribouillis
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 2,726 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  Concatenation ?? ridgerunnersjw 1 1,747 Sep-26-2020, 07:29 PM
Last Post: deanhystad
  Combining two strings together (not concatenation) DreamingInsanity 6 3,183 Mar-29-2019, 04:32 PM
Last Post: DreamingInsanity

Forum Jump:

User Panel Messages

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