December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want your code to stop executing and jump to a different, designated location.
Use a GOTO statement along with a label name to cause code execution to jump into the position where the label is located.
The following example shows the GOTO statement in action. The user is prompted to enter a numeric value, and that value is then evaluated to determine whether it is greater than ten. In either case, a message is printed, and then the code jumps to the end_msg label. If the number entered is a negative number, then the code jumps to the bad_msg label where an error message is printed.
DECLARE
in_number number := 0;
BEGIN
in_number := '&input_number'; IF in_number ...Read now
Unlock full access