How to raise an exception in an HSQLDB procedure or function

What I want to do is just throw an exception in HSQL 2.0.

As in Oracle, we can use: .... EXCEPTION WHEN OTHER THEN raise_application_error (XXX) ....

After reading the official HSQL documentation and trying what I can imagine, I still do not understand.

Is there anyone who can give a suggestion? Thanks!

+4
source share
1 answer

See the SIGNAL instruction in the Manual:

http://hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html#src_psm_exceptions

Example:

SIGNAL SQLSTATE '45000'; 

HSQLDB follows the SQL Standard PSM syntax for procedures and functions. DB2 also follows this syntax, so many DB2 examples can be used with HSQLDB.

+3
source

All Articles