So I'm working on a project at work because they won't give me access to SalesForce backend.I'm attempting to use Python to loop through and update data I've stored in an SQLite3 DB.For some reason, trying to substitute a variable into the SELECT statement will not work. I've done a ton of Googling and ruled out all of the comma errors and such and am still not sure what's going on.Roughly speaking:----------------------------------------------------------------------------------------------cur.execute("SELECT Number FROM UniqueList")PlaceHolder = cur.fetchall()for row in PlaceHolder: cur.execute("SELECT Date FROM UniqueList WHERE Number = ?", row,) print (Date)----------------------------------------------------------------------------------------------So when I run the above, it fails with some error. If I first define the tuple and run it, it fails. If I convert either row (from above) or the defined tuple into a string, the code executes but returns no data, just [].If I substitute an actual number into the SELECT statement as opposed to a variable, it works perfectly and returns dates.I feel like the problem either has to be a data type issue or some restriction with SQLite such as how you can't use a table name as a parameter (that is, as a substitute via variable).Appreciate any help.
10/27/2017 2:41:02 PM
So apparently tuples have to be referenced like arrays, so basically changing row to row[0] fixes it.
10/27/2017 4:03:01 PM
glad i could help
10/27/2017 4:25:52 PM
my work here is done
10/27/2017 4:49:23 PM
Next time you need to download some datas from me, just shoot me a DM and I'll get up with you offline.
10/27/2017 7:10:51 PM
HR uses salesforce to store your pay info. probably why.
10/28/2017 7:16:28 AM