From the course: Oracle Database 19c: PL/SQL
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Programming constructs: WHILE loop - Oracle Database Tutorial
From the course: Oracle Database 19c: PL/SQL
Programming constructs: WHILE loop
- [Instructor] While loops are one of the constructs in PL-SQL to make it a procedural language, looping through a block of code and exiting on a condition at the beginning of the loop. You'll use while where you have complex exit conditions that can't be satisfied by other loop types, and you have a condition in the while statement and further conditions to exit within the loop itself. A while loop is a set of statements in PL-SQL, starting with the while keyword and ending with the keyword end loop, similar to the PL-SQL for loop. The while statement uses a logical condition at the top to evaluate every time through the loop and executes the code in the loop as long as the condition is true. If it evaluates to false or null, the loop exits. Here is the syntax of the while loop in a PL-SQL block. The key to either running the PL-SQL code even once, or ensuring the loop exits is the boolean expression. If it evaluates to…
Contents
-
-
-
-
-
-
-
(Locked)
Programming contstructs: FOR loop5m 57s
-
(Locked)
Programming constructs: WHILE loop5m 1s
-
(Locked)
Programming constructs: LOOP4m 12s
-
(Locked)
Programming constructs: IF statement3m 25s
-
(Locked)
Programming constructs: CONTINUE and EXIT3m 31s
-
(Locked)
New features of PL/SQL loop constructs3m 14s
-
(Locked)
-
-
-
-