Syntax | Example |
Syntax
FOR loop_counter IN [REVERSE]low_bound..high_bound LOOP Statements; END LOOP;
FOR loop_counter IN [REVERSE]low_bound..high_bound LOOP
Statements;
END LOOP;
Note: FOR Loops have a definite number of iterations
Example # 1
The following block inserts 10 (ten) rows into emp table (using FOR loop)
declare no number(10):=1; begin
for no IN 1..10 loop insert into emp(empno) Values (no); 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