Please help. My code for insertion of data to a database returns with an error message:
insertVar =("INSERT INTO %a ( ticker, date, openPrice, dayHigh, dayLow, closePrice, volume ) VALUES ( %s, %s, %s, %s, %s, %s, %s)" %(stripedTicker))TypeError: not enough arguments for format string.
The code is
def insertData (data):
insertVar =("INSERT INTO %a ( ticker, date, openPrice, dayHigh, dayLow, closePrice, volume ) VALUES ( %s, %s, %s, %s, %s, %s, %s)" %(stripedTicker))
cur.execute(insertVar, data)
conn.commit()
The variable data = ['Access Bank Plc', '2018-12-15', '7.45', '7.50', '7.45', '7.45', '18,152,221']
Any help on how to resolve this will be greatly appreciated. Thanks.