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 时终止。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值