I want you to recommend the most optimal way to validate the fields of a table when making an insert by stored procedures, when I say validate I mean that repeated data is not entered in fields that are defined as unique.
My question arises because if I try to make a repeated insert in a single field the system generates an alert but a bit ugly and in English, what I want is to give a clear message to the client that is what really happens when you try to make an insert of that type. Example (The category already exists.) And not an error Code: 1062. Duplicate entry 'GRAINS' for key 'description_UNIQUE'