init
This commit is contained in:
@@ -489,12 +489,7 @@ class HTS:
|
||||
idx += 1
|
||||
|
||||
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:
|
||||
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))
|
||||
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()
|
||||
cursor.close()
|
||||
|
||||
BIN
resources/hts.db
BIN
resources/hts.db
Binary file not shown.
Reference in New Issue
Block a user