On Fri, 09 May 2014 11:15:36 +0200, Dimitry Sibiryakov <s...@ibphoenix.com> wrote: > Hello, All. > > Must multiple error handlers be allowed for the same block? > I.e. something like this: > > BEGIN > .... > WHEN SQLCODE -803 DO .... > WHEN GDSCODE isc_key_violation DO .... > WHEN ANY DO ..... > END
Looking at the language of the Interbase 6.0 - although not very explicit - only a single WHEN is allowed (it says "If used, WHEN must be the last statement in a BEGIN…END block."), however you are allowed to use multiple error codes in a single WHEN, so you can have a single WHEN block and handle the specifics by using the GDSCODE, SQLCODE etc context variables (although unfortunately there is no context variable for EXCEPTION. So although multiple WHENs might be handy, they are - afaik - currently not allowed, and this limitation can be worked around. Another - dirty - trick as a work around might be nested BEGIN ... WHEN ... END, one for each condition to handle. Mark ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel