| The MSP language is based closely on the SQL92 PSM (Persistent Stored Modules)
standard. The language exists to trap and process exceptions. It is just
that Rdb has not implemented the exception handler. This is currently an
architectural restriction which we plan to address eventually.
Currently, GET DIAGNOSTICS can be used to test for success, and various
warnings such as string-truncation, end-of-stream, and null-elimination.
In addition the syntax:
get diagnostics exception n = returned_sqlcode
allows you get various levels of exception. We currently only support 1.
i.e. get diagnostics exception 2 = returned_sqlcode is legal according to ANSI
and ISO SQL.
~when an exception is generated (NO_DUP error ect.) in a compound statment in
~a module
A better method is to avoid the exception:
if exists (select * from T where a = :val) then
signal 'xxxxx'
else
insert into T (...) values (..., :val, ...);
end if;
cheers,
Ian
|
| Thanks very much for your explanation.
jay
+------------------------------------------------------------------------+
| "Yes, I think it can be most easily done, out on Rdb 6.1"
|
| -- Bob Dylan
| Rdb 6.1 Revisited
+------------------------------------------------------------------------+
|