Oracle/PLSQL: Exit Statement

Oracle/PLSQL: Exit Statement

The syntax for the EXIT statement is:
译: EXIT statement 的语法如下:
EXIT [WHEN boolean_condition];
The EXIT statement is most commonly used to terminate LOOP statements.
译: EXIT statement 通常用于终止 LOOP 语句
Let's take a look at an example:
译:看一个示例
LOOP
monthly_value := daily_value * 31;
EXIT WHEN monthly_value > 4000;
END LOOP;
In this example, the LOOP would terminate when the monthly_value exceeded 4000.
译:在这个示例中,当 monthly_value 的值大于 4000 的时候, LOOP 循环就会终止

你可能感兴趣的:(oracle)