Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cursor = connection.cursor()
- for item in list:
- try:
- cursor.execute(sql_insert_statement, (item,))
- except fdb.DatabaseError:
- log(f"Exception: duplicate found in database for {item}")
- continue
- finally:
- con.commit()
Add Comment
Please, Sign In to add comment