please help! I am using sqlite3 in ipython notebook to create an SQL database. I think I have successfully created the database, but when I go to look at it I am receiving an encoding UTF8 error. Here is my code:
import sqlite3
conn=sqlite3.connect('example.db')
c=conn.cursor()
c.execute('''DROP TABLE PROFILE''')
c.execute('''CREATE TABLE PROFILE
( FIRSTNAME TEXT PRIMARY KEY unique NOT NULL,
LASTNAME TEXT NOT NULL,
EMAILADDRESS TEXT NOT NULL,
PASSWORD TEXT NOT NULL,
CURRENTJOBTITLE TEXT NOT NULL,
EDUCATION TEXT NOT NULL);''')
conn.close()
conn = sqlite3.connect('example.db')
c = conn.cursor()
conn.execute("INSERT INTO PROFILE (FIRSTNAME, LASTNAME, EMAILADDRESS, PASSWORD, CURRENTJOBTITLE, EDUCATION) \
VALUES ('SALLYSUE','SUE','SALLYSUE@YAHOO.COM','ABC', 'STUDENT', 'GRAD')");
conn.commit()
conn.close()
This is the end of my Code. When I go to look at the file created 'example.db' this is where I see the below error:
Error! C:\Users\Lastname\CSE801\example.db is not UTF-8 encoded
Saving disabled.
See Console for more details
So I am not able to see the table I am creating in SQL.
I googled this and found that people said to put this in my code
import sys
reload(sys)
sys.setdefaultencoding()
Well once I do this and try to rerun my code the code produces nothing. It won't run the code at all. Does anyone have any suggestions? Thanks!