In [22]:
import sqlite3
connect = sqlite3.connect('simple_sqlite3.db')
cursor = connect.cursor()
def tableCreate():
cursor.execute("CREATE TABLE SAMSUNG(ID INT, datestamp TEXT, value REAL)")
In [23]:
tableCreate()
In [24]:
cursor.execute("INSERT INTO SAMSUNG VALUES(1, '2015-07-01', 50000)")
connect.commit()
In [29]:
# -*- coding: utf-8 -*-
import sqlite3
connect = sqlite3.connect('test.db')
cursor = connect.cursor()
cursor.execute("CREATE TABLE SAMSUNG(ID INT, datestamp TEXT, value REAL, dada TEXT)")
cursor.execute("INSERT INTO SAMSUNG VALUES(1, '2015-07-01', 50000, '한글1')")
connect.commit()
In [30]:
text_title = u'\xa0\uad6d\ub0b4 \ud658\uc728 \ub9c8\uac10\uc2dc\ud669'
print text_title
In [35]:
connect = sqlite3.connect('test.db')
cursor = connect.cursor()
cursor.execute("INSERT INTO SAMSUNG VALUES (?,?,?,?)", (1, '2015-07-02', 10000, text_title) )
connect.commit()