An EXCEPTION WHEN ... THEN
clause that only rethrows the caught exception has the same effect as omitting the EXCEPTION
clause altogether and letting it bubble up automatically.
BEGIN
SELECT 1/0;
EXCEPTION
WHEN ZERO_DIVIDE THEN
RAISE; -- Noncompliant
WHEN OTHERS THEN
RAISE; -- Noncompliant
END;
Such clauses should either be removed or populated with the appropriate logic.
BEGIN
SELECT 1/0;
EXCEPTION
WHEN ZERO_DIVIDE THEN
-- do something to manage the division by zero
COMMIT;
WHEN OTHERS THEN
ROLLBACK;
END;