Page 1 of 1

Error Trapping for dups and other

PostPosted: Mon Mar 09, 2020 2:47 pm
by gkick
Hi all,

recently found this gem viewtopic.php?f=61&t=68434
relating to error trapping avoiding duplicates, which works beautifully. If I remember correctly Access had/has error codes which made intercepting errors fairly straight forward.
The code in the link for making a friendlier error message says SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'already exists'; , however the code in the non handled error just says constraint or index violation. (How does one extrapolate the error number aka 45000 ?)
Where can one find other codes such as for intercepting if a table is read only. The HSQDB manual does not seem to have any info on this.