Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tuple and formating problem
#6
If it is in the same form as "150, 110, 1, 164":

(assumes uid is a string)

sql = "SELECT * FROM anställda WHERE ID = ?"
data = (uid,) # you need the comma as it expects a tuple!

conn.execute(sql, data)

Does this work?
Reply


Messages In This Thread
tuple and formating problem - by darktitan - Feb-17-2019, 05:44 PM
RE: tuple and formating problem - by marienbad - Feb-17-2019, 05:56 PM
RE: tuple and formating problem - by darktitan - Feb-17-2019, 06:22 PM
RE: tuple and formating problem - by marienbad - Feb-17-2019, 06:57 PM
RE: tuple and formating problem - by darktitan - Feb-17-2019, 07:09 PM
RE: tuple and formating problem - by marienbad - Feb-17-2019, 07:14 PM
RE: tuple and formating problem - by darktitan - Feb-17-2019, 07:24 PM
RE: tuple and formating problem - by marienbad - Feb-17-2019, 07:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Formating generated .data file to XML malcoverc 3 1,400 Apr-14-2022, 09:41 PM
Last Post: malcoverc
  propper formating paracelsusx 2 1,937 Jul-16-2021, 09:17 AM
Last Post: perfringo
  Adding graph points and formating project_science 4 2,439 Jan-24-2021, 05:02 PM
Last Post: project_science
  code with no tuple gets : IndexError: tuple index out of range Aggam 4 2,890 Nov-04-2020, 11:26 AM
Last Post: Aggam
  Excel: Apply formating of a sheet(file1) to another sheet(file2) lowermoon 1 2,077 May-26-2020, 07:57 AM
Last Post: buran
  How to get first line of a tuple and the third item in its tuple. Need Help, Anybody? SukhmeetSingh 5 3,278 May-21-2019, 11:39 AM
Last Post: avorane
  pymysql: formating ouput of query wardancer84 18 8,464 Oct-04-2018, 01:54 PM
Last Post: wardancer84
  Problem between list and tuple PierreSoulier 2 2,815 Jul-19-2018, 12:40 PM
Last Post: PierreSoulier
  Tuple Space with lindypy Problem draems 0 2,596 Sep-19-2017, 07:00 AM
Last Post: draems
  output formating mcmxl22 2 3,094 Jun-19-2017, 07:21 PM
Last Post: buran

Forum Jump:

User Panel Messages

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