Inserindo vários valores com execute many

This commit is contained in:
Luiz Otávio
2023-04-01 14:48:26 -03:00
parent ee84abc178
commit 074a2f3cdf

View File

@@ -36,7 +36,13 @@ sql = (
'VALUES '
'(?, ?)'
)
cursor.execute(sql, ['Joana', 4])
# cursor.execute(sql, ['Joana', 4])
cursor.executemany(
sql,
(
('Joana', 4), ('Luiz', 5)
)
)
connection.commit()
print(sql)