Rich Leick was brought into a major insurance company as a consultant to help them with managing defects and bugs in their core underwriting application. One major problem Rich noticed was that support developers had little-to-no information about the problems they were assigned to fixed: the application provided no logging and all of the error messages simply read "An error occurred. Please try again."

After Rich spent a few weeks adding copious amounts of logging, tracing, and error handling code to the system, the developers were thrilled. They finally had some direction to go when they were assigned a bug. Still, there was one thing that struck Rich as rather odd: the database was throwing lots and lots of "divide by zero" errors.

A little bit of investigation led Rich to the core of the problem, the ABORT_PROCEDURE procedure. Rather than throwing and handling exceptions within the procedures, the original developers decided to use this instead ...

CREATE OR REPLACE PROCEDURE ABORT_PROCEDURE IS
  --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
  -- Parameters:     NONE                                                                       ==
  -- Purpose:        FORCE END OF STORED PROCEDURE                                              ==
  -- Interval:       Called From Other Programs.                                                ==
  -- Tables:         NONE                                                                       ==
  -- Sub Programs:   NONE                                                                       ==
  -- Author:         S. Nagheenanajar                                                           ==
  -- Create Date:    2002-10-08                                                                 ==
  -- Revisions:                                                                                 ==
  --   Author                    Date       Description                                         ==
  --   ------------------------- ---------- -------------------------------------------------   ==
  --   M. Bolton                 2003-06-09 Changed to DIV0 error instead of overflow error     ==
  --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==

  --= VARIABLES ==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
  v_divzero NUMBER;

  --= PROCEDURE BODY =--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
  BEGIN
    v_divzero := 7;
    v_divzero := v_divzero / 0;
  END;

  --= PROCEDURE END ==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!