All errors generated by Common SQL are of type
sql-database-error. You can test for these conditions and their subtypes in your error handlers.
An sql-user-error is an error inside Lisp.
An sql-database-error is an error inside the database interface that Lisp uses.
The following are subclasses of sql-database-error:
The following are subclasses of sql-connection-error:
Note: In general, the documentation for the various supported databases make it difficult to decide which error code should be made into which of the above condition class, and we probably get many of these wrong. If you find errors that seem to be signaled with the wrong condition class, please report them to Lisp Support, including the full printout of the condition, and we will fix it.
Three functions are provided which access slots of sql-database-error, allowing you to discover more about the actual error that occurred.
sql-error-secondary-error-id return primary and secondary error identifiers. If you use these, please read the detailed description in sql-database-error.
LispWorks User Guide and Reference Manual - 20 Sep 2017