'1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
I am following the mysql coding examples to insert data into a table I created but I am receiving an issue related to the syntax I am using for my MYSQL server version (8.0). I am using python connector.
Error: "mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Return, Ticker) VALUES (2020, 10.0, 'GGAL')' at line 1"
Below are the lines of code I am using:
add_data = ("INSERT INTO yoy_heatmap "
"(Year, Return, Ticker) "
"VALUES (%(Year)s, %(Return)s, %(Ticker)s)")
record = {
'Year': 2020,
'Return': 10.0,
'Ticker': 'GGAL',
}
mycursor.execute(add_data, record)
mydb.commit()
Is there a difference on the syntax for this server version that is not updated in MySQL Connector/Python Developer Guide? This is the link to the guide I am using: https://dev.mysql.com/doc/connector-python/en/connector-python-example-cursor-transaction.html
Thanks in advance for your help!!!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
