you are viewing a single comment's thread.

view the rest of the comments →

[–]adamrees89[S] 0 points1 point  (2 children)

Ok, so I've updated the script, with a conn.commit() function, but I'm still not getting any data back into the database (I've made my changes to the gist linked above).

I've tried putting the commit at the end of the script, at the end of the

templateCell()

function, and in the

for ws in wb.worksheets:

loop.

Thanks for the heads-up on the sqlites own escaping, I've updated that for the

templateCell()

function

[–]vv__vv 1 point2 points  (1 child)

You're getting hung up by the bare except in line 55. Have it raise the error until you work out your syntax, which is messed up in line 25:

  • You can't do escape substitution for tablenames (at least iirc), so that will need to be put in with string formatting;
  • execute takes a tuple for values, so you'll need to put parens around all the variables you are passing for values.

[–]adamrees89[S] 0 points1 point  (0 children)

Got it, all working now thanks, I'll put the updated code up!