Created
May 8, 2019 18:43
-
-
Save StephenFordham/8f31427c195cf9cfcb24cb27b736b689 to your computer and use it in GitHub Desktop.
insert_into
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
del fList[0] | |
rows = '' | |
for i in range(len(fList)-1): | |
rows += "('{}','{}','{}','{}','{}','{}','{}','{}','{}','{}')"\ | |
.format(fList[i][0], fList[i][1], fList[i][2], fList[i][3], fList[i][4], | |
fList[i][5], fList[i][6], fList[i][7], fList[i][8], fList[i][9]) | |
if i != len(fList)-2: | |
rows += ',' | |
print(rows) | |
queryInsert = "INSERT INTO FOOTBALL VALUES" + rows | |
cursor.execute(queryInsert) | |
mydb.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment