The previous section showed how to set breakpoints to stop the code at predetermined lines of code. TOAD also allows "conditional" breakpoints. Figure 4.55 illustrates how to set a breakpoint so that execution stops after 10 times though the loop. Press F11 to execute the procedure. Notice in Figure 4.56 that a watch was placed on the loop_counter variable and that the loop_counter is at 9. This is because the loop is on its tenth iteration and the variable loop_counter (where the breakpoint is set) has not been incremented yet. Figure 4.55. Setting a conditional breakpoint.
Figure 4.56. Conditional breakpoint in action.
Figure 4.57 illustrates how to set a conditional breakpoint on a particular condition such as 'ENAME = SMITH'. When running the procedure, position the mouse over the 'rec. name ' on line 11 and you will see that the code did stop executing when the ENAME of SMITH was located. If you check the loop_counter variable, you will notice that it is at 0, so SMITH just happens to be the first row returned. Figure 4.57. Conditional breakpoint in action (2).
|