Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. mysql.connector.errors.ProgrammingError: Not all parameters were used in the SQL statement
  2.  
  3. import mysql.connector
  4. for table in tables:
  5. sql = """insert into close_price select * from ? where identifier = 'OMXS30' and seconds_offs = (select max(seconds_offs)
  6. from ? where seconds_offs <= 55800 and identifier = 'OMXS30'"""
  7. cursor = mySQLconnection.cursor()
  8. cursor.execute(sql, [table[0], table[0]])
  9.  
  10. for table in tables:
  11. sql = """insert into close_price select * from {} where identifier = 'OMXS30' and seconds_offs = (select max(seconds_offs)
  12. from {} where seconds_offs <= 55800 and identifier = 'OMXS30'""".format(table[0], table[0])
  13. cursor = mySQLconnection.cursor()
  14. cursor.execute(sql)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement