`
JAVA天地
  • 浏览: 658905 次
  • 性别: Icon_minigender_1
  • 来自: 太原
文章分类
社区版块
存档分类
最新评论

Oracle/PLSQL: While Loop

阅读更多
Oracle/PLSQL: While Loop

The syntax for the WHILE Loop is:
WHILE condition
LOOP
{.statements.}
END LOOP;
You would use a WHILE Loop when you are not sure how many times you will execute the loop body. Since the WHILE condition is evaluated before entering the loop, it is possible that the loop body may not execute even once.
译:当你不确定循环体有多少次的时候,可以使用WHILE LOOP。因为在进入循环以前,WHILE的条件是先给的,因为可能循环体不止执行一次。
Let's take a look at an example:
WHILE monthly_value <= 4000
LOOP
monthly_value := daily_value * 31;
END LOOP;
In this example, the WHILE Loop would terminate once the monthly_value exceeded 4000.
译:在该示例中,WHILE循环将会在monthly_value的值达到4000时终止。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics