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, 1418🔥, 0💬
Popular Posts:
How To Generate CREATE VIEW Script on an Existing View in SQL Server? If you want to know how an exi...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...
Where to find answers to frequently asked questions I am new to Oracle database. Here is a list of f...
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...