diff options
Diffstat (limited to 'examples/copy_to.py')
-rw-r--r-- | examples/copy_to.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/copy_to.py b/examples/copy_to.py index f4433ed..2eea672 100644 --- a/examples/copy_to.py +++ b/examples/copy_to.py @@ -46,8 +46,7 @@ data = [('Tom', 'Jenkins', '37'), ('Madonna', None, '45'), ('Federico', 'Di Gregorio', None)] query = "INSERT INTO test_copy VALUES (%s, %s, %s)" -for row in data: - curs.execute(query, row) +curs.executemany(query, data) conn.commit() # copy_to using defaults |