Open alixTal opened 8 months ago
test_data = [ ('Donna', date(2022, 4, 14)), ('Eric', date(2023, 6, 21)), ('Kelso', date(2018, 9, 12)), ] stmt = "INSERT INTO names (first_name, date) VALUES (%s, %s)" cursor.executemany(stmt, test_data)
When I use executemany it's look like loop through them and insert one by one.
executemany
Isn't supposed to turn it to something like this and send at once?
INSERT INTO names (first_name, date) VALUES ('Donna', '2022-4-14'), ('Eric', '2023-6-21'), ('Kelso', '2018-9-12')
When I use
executemany
it's look like loop through them and insert one by one.Isn't supposed to turn it to something like this and send at once?