Oracle: SQL*PLUS - While Loops  

Syntax | Example |

 

 

Syntax

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 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