Oracle: SQL*PLUS - FOR Loops  

Syntax | Example |

 

 

Syntax

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 TABLE
Database - SQL* PLUS - For Loops
Database - SQL* PLUS - Primary key (two-column)
Oracle PL/SQL - Procedures
Database - SQL* PLUS - Simple Loop
Database - SQL* PLUS - While Loops

 

 

 


 

 

 

 

 

 

 

Custom Search
 

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