Databases Reference
In-Depth Information
handler—or it leaves the condition unhandled, causing it to be propagated outward, either
to another compound statement in which the compound statement containing the condition
is nested or to the application that invoked the routine.
A database module consists of one compound statement in which other compound
statements are nested. Each compound statement has its exception handler. Each condi-
tion has its compound statement. During execution, if an exception is raised from an SQL
statement then the control is transferred from the current statement to the exception handler
according to the type of the exception raised.
Suggested Technique
A node in the control fl ow graph should represent each statement. These statements
are either SQL statements, control statements or others. Each node, especially those repre-
senting SQL statements, has two possible outcomes—either a success or a failure, with an
exception raised. Nodes containing control statements have more than one success outcome
(most of the time two outcomes, as in the case of if statements). The exceptions raised be-
if
long to a large list of possible exceptions that might be raised in the database environment,
like duplicate value on index, value could not be null, or others. Because we cannot limit
or predict the type of exception that could be raised by a statement, we prefer to represent
the control transfers due to exceptions with one link. This link is later routed to the proper
destination according to the type of the exception.
A compound statement contains a list of statements with one exception handler for all
of these statements. A node represents each of these statements. The compound statement
if statements). The exceptions raised be-
Figure 1: Flow graph modeling of compound statements
Search WWH ::




Custom Search