错误描述:sqlite3.OperationalError: near "(": syntax error
错误原因:
Traceback (most recent call last):
File "E:\CSWDpassive\draft.py", line 94, in <module>
df_to_db(dbPath, tbName, csvPath)
File "E:\CSWDpassive\draft.py", line 34, in df_to_db
c.execute('CREATE TABLE if not exists {} (year INT NOT NULL, month INT NOT NULL, day INT NOT NULL,'
sqlite3.OperationalError: near "(": syntax error
Traceback (most recent call last):
File "E:\CSWDpassive\draft.py", line 94, in <module>
df_to_db(dbPath, tbName, csvPath)
File "E:\CSWDpassive\draft.py", line 34, in df_to_db
c.execute('CREATE TABLE if not exists {} (year INT NOT NULL, month INT NOT NULL, day INT NOT NULL,'
sqlite3.OperationalError: near "(": syntax error
tbName = '淮阴(清江)'
tbName = '淮阴(清江)'
tbName中的‘(清江)’导致错误
解决方法:
tbName = '淮阴'