PL / SQL में 'FOR ENDLOOP ' स्टेटमेंट को उदहारण सहित समझाइये।
Answers
Explanation:
Introduction to PL/SQL LOOP Statement
PL/SQL LOOP statement is an iterative control statement that allows you to execute a sequence of statements repeatedly like WHILE and FOR loop.
The simplest form of the LOOP statement consists of the LOOP keyword, a sequence of statements and the END LOOP keywords as shown below:
LOOP
sequence_of_statements;
END LOOP;
1
2
3
LOOP
sequence_of_statements;
END LOOP;
Note that there must be at least one executable statement between LOOP and END LOOP keywords. The sequence of statements is executed repeatedly until it reaches a loop exit. PL/SQL provides EXIT and EXIT-WHEN statements to allow you to terminate a loop.
The EXIT forces the loop halts execution unconditionally and passes control to the next statement after the LOOP statement. You typically use the EXIT statement with the IF statement.
The EXIT-WHEN statement allows the loop to terminate conditionally. When the EXIT-WHEN statement is reached, the condition in the WHEN clause is checked. If the condition evaluates to TRUE, the loop is terminated and control is passed to the next statement after the keyword END LOOP. If the condition evaluates to FALSE, the loop will continue repeatedly until the condition evaluates to TRUE. Therefore, if you don’t want to have an infinite loop, you must do something inside the loop to make condition becomes TRUE
HOPE IT HELPS YOU ! PLZ MARK IT AS BRAINLIEST
Explanation:
PL/SQL LOOP statement is an iterative control statement that allows you to execute a sequence of statements repeatedly like WHILE and FOR loop.
The simplest form of the LOOP statement consists of the LOOP keyword, a sequence of statements and the END LOOP keywords as shown below: