You can test the hypothesis that the problem is the lack of initialization for top_value right in the debugger, without changing the procedure code.
In the Debugger Details window, click the Local tab.
Click the top_value variable and type 3000 in the Value field.
Press F11 repeatedly until the Value field of the This_Value variable is greater than 3000.
Click the breakpoint so that it turns gray.
Press F5 to execute the procedure.
The Interactive SQL window appears again. It shows the correct results.
The hypothesis is confirmed. The problem is that the top_value is not initialized.
Choose Mode » Design.
In the right pane, locate the following statement:
Type a new line that initializes the top_value variable:
SET top_value = 0;
Choose File » Save.
Execute the procedure again, and confirm that Interactive SQL displays the correct results.
You have now completed the lesson. Close any open Interactive SQL windows.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0|