While Loop in PL/SQL

Advertisements

PLSQL Conditional Statement PLSQL Procedure

For While in PL/SQL

Set of instructions given to the compiler to execute set of statements until condition becomes false is called loops. The basic purpose of loop is code repetition that means same code repeated again and again. Here we discuss While loop in PLSQL

A while loop is used when a set of statements has to be executed as long as a condition is true, the While loop is used. The condition is decided at the beginning of each iteration and continues until the condition becomes false.

Syntax

variable initialize

while (condition)
statements;
end loop;

Must be follow below steps;

  • Initialise a variable before the loop body.
  • Increment the variable in the loop body.

While Loop in PLSQL

DECLARE  
i INTEGER := 1;  
BEGIN  
WHILE i <= 10 LOOP  
DBMS_OUTPUT.PUT_LINE(i);  
i := i+1;  
END LOOP;  
END;  

Output

1
2
3
4
5
6
7
8
9
10

PLSQL Conditional Statement PLSQL Procedure

Advertisements

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Download Projects

Advertisements


Buy Websites 9999595223

Buy Fresh and Payment Receive Media.net Account with Website. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs