This commit is contained in:
dsyoon
2022-08-03 16:19:15 +09:00
parent 70e189da01
commit 284297efca
2 changed files with 1 additions and 6 deletions

View File

@@ -489,12 +489,7 @@ class HTS:
idx += 1 idx += 1
cursor.execute('DELETE FROM ' + tableName + ' WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,)) 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("INSERT INTO " + tableName + "(CODE, NAME, ymd, hms, close, open, high, low, volume) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", (stock_code, stock_name, ymd, hms, close, open, high, low, volume))
result = cursor.fetchone()
if result == None:
cursor.execute(
"INSERT INTO " + tableName + "(CODE, NAME, ymd, hms, close, open, high, low, volume) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
(stock_code, stock_name, ymd, hms, close, open, high, low, volume))
conn.commit() conn.commit()
cursor.close() cursor.close()

Binary file not shown.