Created
February 22, 2024 14:04
-
-
Save deepanshumehtaa/12d3e4c92f15073481e8fbef48cb4fb8 to your computer and use it in GitHub Desktop.
Bulk Insert Update
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
Bulk Insert: | |
def bulk_insert(self, sql, sql_parameters, batch_size=1000): | |
for i in range(0, len(sql_parameters), batch_size): | |
batch = sql_parameters[i:i+batch_size] | |
cursor = self.get_connection_cursor() | |
cursor.executemany(sql,batch) | |
self.connection.commit() | |
Bulk Uptdae: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment