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, 2558🔥, 0💬
Popular Posts:
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...
How To Replace Given Values with NULL using NULLIF() in SQL Server Transact-SQL? Sometime you want t...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...