Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
adds note to exception regarding round id
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordie0608 committed Nov 23, 2017
1 parent c6b45dc commit b6124b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SQL/feedback_conversion_2017-11-12.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,11 @@ def pick_parsing(var_name, var_value, details, multirows_completed):
print("Conversion completed at {0}".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
print("Script duration: {0}".format(end_time - start_time))
except Exception as e:
cursor.execute("SELECT round_id FROM {0} WHERE id = {1}".format(current_table, current_id-1))
query_round_id = cursor.fetchone()
end_time = datetime.now()
print("Error encountered on row ID {0} at {1}".format(current_id, datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
print("Note SQL insertion errors will be due to data from round ID {0}".format(query_round_id[0])) #since data is inserted when the round id changes on a new row
print("Script duration: {0}".format(end_time - start_time))
cursor.execute("TRUNCATE {0} ".format(new_table))
raise e
Expand Down

0 comments on commit b6124b7

Please sign in to comment.