Jun-27-2018, 01:59 PM
With sql alchemy the error message:
IntegrityError: (_mysql_exceptions.IntegrityError) (1062, "Duplicate entry...)
will occur when you try to enter data with identical primary keys as another data row already in the database.
And to my understanding depending on whether you are in Debug 0 or 1 you would receive either a 500 error or a internal server error respectively.
I am looking to input large csv files which could contain duplication, what i would like to do is instead of just throwing up an error.
> Upload all csv rows not within the database.
> Display the rows that were not uploaded.
There i will need to create my own '1062 error' that gets thrown up instead of the normal errors.Is this possible? can i interrupt the usual sql error system and implement my own? if anyone knows the location of my answers I would be grateful.
IntegrityError: (_mysql_exceptions.IntegrityError) (1062, "Duplicate entry...)
will occur when you try to enter data with identical primary keys as another data row already in the database.
And to my understanding depending on whether you are in Debug 0 or 1 you would receive either a 500 error or a internal server error respectively.
I am looking to input large csv files which could contain duplication, what i would like to do is instead of just throwing up an error.
> Upload all csv rows not within the database.
> Display the rows that were not uploaded.
There i will need to create my own '1062 error' that gets thrown up instead of the normal errors.Is this possible? can i interrupt the usual sql error system and implement my own? if anyone knows the location of my answers I would be grateful.