Jul-11-2019, 09:31 PM
Hello,
Would anyone be able to help me out with the python code. I have been trying to write a code to read a value from .csv file and insert it into the mysql database. Unfortunately, I keep getting the error that syntax is incorrect.
This is the code I have written:
cur.execute("INSERT INTO Leashold_tb (leashold_or_not) VALUES (%(leashold_or_not,)s), ")
The error message I get is:
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
I have been looking into many guides online, but I just can not find the correct way.
Would anyone be able to help me out here?
Thanks,
justin_py
Would anyone be able to help me out with the python code. I have been trying to write a code to read a value from .csv file and insert it into the mysql database. Unfortunately, I keep getting the error that syntax is incorrect.
This is the code I have written:
cur.execute("INSERT INTO Leashold_tb (leashold_or_not) VALUES (%(leashold_or_not,)s), ")
The error message I get is:
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
I have been looking into many guides online, but I just can not find the correct way.
Would anyone be able to help me out here?
Thanks,
justin_py