This commit is contained in:
dosangyoon
2022-07-29 15:47:58 +09:00
parent c27eed6be0
commit 7e7998e335

View File

@@ -460,8 +460,7 @@ class HTS:
cursor = conn.cursor()
# 테이블 생성
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)")
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_key = "CREATE INDEX IF NOT EXISTS " + tableName + "_idx on " + tableName + " (CODE, ymd, hms) "
@@ -488,6 +487,7 @@ class HTS:
conn = sqlite3.connect(inFileName)
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,))
result = cursor.fetchone()
if result == None: