init
This commit is contained in:
@@ -460,8 +460,7 @@ class HTS:
|
|||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# 테이블 생성
|
# 테이블 생성
|
||||||
cursor.execute(
|
cursor.execute("CREATE TABLE IF NOT EXISTS " + tableName + " (CODE text, NAME text, ymd text, hms text, close REAL, open REAL, high REAL, low REAL, volume REAL)")
|
||||||
"CREATE TABLE IF NOT EXISTS " + tableName + " (CODE text, NAME text, ymd text, hms text, close REAL, open REAL, high REAL, low REAL, volume REAL)")
|
|
||||||
|
|
||||||
# 키 생성
|
# 키 생성
|
||||||
create_key = "CREATE INDEX IF NOT EXISTS " + tableName + "_idx on " + tableName + " (CODE, ymd, hms) "
|
create_key = "CREATE INDEX IF NOT EXISTS " + tableName + "_idx on " + tableName + " (CODE, ymd, hms) "
|
||||||
@@ -488,6 +487,7 @@ class HTS:
|
|||||||
conn = sqlite3.connect(inFileName)
|
conn = sqlite3.connect(inFileName)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
|
cursor.execute('DELETE FROM ' + tableName + ' WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,))
|
||||||
cursor.execute('SELECT * FROM ' + tableName + ' WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,))
|
cursor.execute('SELECT * FROM ' + tableName + ' WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,))
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
if result == None:
|
if result == None:
|
||||||
|
|||||||
Reference in New Issue
Block a user