Timeline for Insert multiple values in MySQL with Python from an array
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 20, 2020 at 9:12 | history | edited | Community Bot |
Commonmark migration
|
|
| Jan 4, 2020 at 0:00 | vote | accept | massideux | ||
| Jan 3, 2020 at 22:52 | history | edited | massideux | CC BY-SA 4.0 |
added 207 characters in body
|
| Jan 3, 2020 at 22:22 | history | edited | massideux | CC BY-SA 4.0 |
deleted 53 characters in body
|
| Jan 3, 2020 at 21:35 | history | edited | massideux | CC BY-SA 4.0 |
added 32 characters in body
|
| Jan 3, 2020 at 20:54 | comment | added | gold_cy |
then you need array to be a list of list where each inner list has a length of 3
|
|
| Jan 3, 2020 at 20:47 | comment | added | massideux | The array contains way more data then 3, my three columns in the DB will contain a lot of rows. | |
| Jan 3, 2020 at 20:24 | comment | added | gold_cy |
if len(array) == 3 then you don't need a for-loop simply doing cursor.execute(query, array) should work
|
|
| Jan 3, 2020 at 20:22 | comment | added | massideux | Hmm you might be on to something, I believe a list of strings. So it might think everything I'm iterating is one big string? | |
| Jan 3, 2020 at 20:21 | answer | added | Adrian Beloqui | timeline score: 1 | |
| Jan 3, 2020 at 20:18 | comment | added | gold_cy |
is array a list of lists or just a list of strings, because it looks like you are just iterating over a list of strings and for each string are trying to do an executemany that is expecting 3 parameters but you only pass 1
|
|
| Jan 3, 2020 at 20:10 | review | First posts | |||
| Jan 3, 2020 at 20:24 | |||||
| Jan 3, 2020 at 20:08 | history | asked | massideux | CC BY-SA 4.0 |