0

i write this query in my flask restful api when i hit it from postman this shows the error mentioned on top. not all arguments converted during string formatting

cur.execute('''DELETE FROM `students`.`std_record`
                WHERE `roll_num` = %s;''', (roll_num))
davidism
  • 121,510
  • 29
  • 395
  • 339

1 Answers1

0

You have improperly formatted the variable you want to pass (currently it supplies a list of the characters of roll_num), it should be passed as a tuple (containing one item), like so:

cur.execute('''DELETE FROM `students`.`std_record`
            WHERE `roll_num` = %s;''', (roll_num,))
iacob
  • 20,084
  • 6
  • 92
  • 119