Collections:
Use "WHILE" Loop Statements in Oracle
How To Use "WHILE" Loop Statements in Oracle?
✍: FYIcenter.com
If you have a block of codes to be executed repeatedly based a condition, you can use the "WHILE ... LOOP" statement. Here is a sample script on WHILE statements:
DECLARE total NUMBER; BEGIN total := 0; WHILE total < 10 LOOP total := total+1; END LOOP; DBMS_OUTPUT.PUT_LINE('Total counts: ' || TO_CHAR(total)); END;
This script should print this:
Total counts: 10
⇒ Use "FOR" Loop Statements in Oracle
⇐ Use "IF" Statements with Multiple Conditions in Oracle
2018-07-13, 1597🔥, 0💬
Popular Posts:
What Are the Differences between DATE and TIMESTAMP in Oracle? The main differences between DATE and...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...