I'm running on Python 3.8 and have the following code:
conn = sqlite3.connect('feedback.db')
c = conn.cursor()
read_feedback = pd.read_csv (r'C:jupfeedback.csv', parse_dates=['Created'])
read_feedback.to_sql('FEEDBACK_IN', conn, if_exists='append', index = False) # Insert the values from the csv file into the table 'FEEDBACK_IN'
c.execute('''INSERT INTO FEEDBACK_IN (Feedback, Created, User)''')`
The table has been created using this code:
c.execute('''CREATE TABLE FEEDBACK_IN
([generated_id] INTEGER PRIMARY KEY,[Feedback] text, [Created] date, [User] text)''')
The sample from the csv:
Feedback,Created,User
Quick help. Thank you!,29/12/2020,[email protected]
The dataframe from csv looks ok:
Feedback Created User
0 Quick help. Thank you! 2020-12-29 [email protected]
When I reach c.execute('''INSERT INTO FEEDBACK_IN (Feedback, Created, User)''') I get get an error thrown:
----> 1 c.execute('''INSERT INTO FEEDBACK_IN (Feedback, Created, User)''')
OperationalError: incomplete input
I have played with the date formats, sequence of fields, now lost.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…