How to raise Exception in HSQLDB procedure or function
What I want to do is just raise a exception开发者_如何学Go in HSQL 2.0.
As in Oracle we can use : .... EXCEPTION WHEN OTHERS THEN raise_application_error(XXX) ....
After read HSQL official documentation and tried what I can imagine , I still didn't get a clue.
Is there anybody can give a suggestion ? Thanks!
See the SIGNAL statement in the Guide:
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. This syntax is also followed by DB2, therefore many DB2 examples can be used with HSQLDB.
精彩评论