Syntax | Example |
Syntax
WHILE condition LOOP Statements; END LOOP;
WHILE condition LOOP
Statements;
END LOOP;
Note : The condition is evaluated before each iteration of the loop
Example # 1
The following block inserts 10 (ten) rows into emp table (using While Loop)
declare no number(10):=1; begin while no<=10 loop insert into emp(empno) Values (no); no:=no+1; end loop; end; /
ORACLE - PL/SQL
Database - SQL* PLUS - Primay key (1 column)Database - SQL* PLUS - Crete TABLEDatabase - SQL* PLUS - For LoopsDatabase - SQL* PLUS - Primary key (two-column)Oracle PL/SQL - ProceduresDatabase - SQL* PLUS - Simple LoopDatabase - SQL* PLUS - While Loops
Home Disclaimer Advertise Contact Privacy Policy
Copyright © 2004-10 Paked.com. All rights reserved.
Note: Site best viewed at 1024 x 768 or higher screen resolution