I need to save in log_table type of exception that raised. What if I have more constraints and i want to know which one is violating integrity rules. I am doing it in MySQL
I have this, but it only record all exceptions
START TRANSACTION;
TRY
INSERT INTO example_table (name) VALUES ('Sample Name');
CATCH
ROLLBACK;
INSERT INTO log_table (note) VALUES ('exception raised');
END TRY;
COMMIT;