PL/SQL tutorial 12: PL/SQL WHILE Loop in Oracle Database

Iterative statements/loop series learn the concepts of While Loop in PL/SQL or In Oracle Database with Examples. also learn how to handle boolean expression in while loop
————————————————————————
►►►LINKS◄◄◄
Blog : http://bit.ly/while-loop-in-pl-sql
Previous Tutorial
► Simple Loop: https://youtu.be/AFx6QYcY1CU
————————————————————————-
►►►Let’s Get Free Uber Cab◄◄◄
Use Referral Code UberRebellionRider and get $20 free for your first ride.

————————————————————————-
►Make sure you SUBSCRIBE and be the 1st one to see my videos!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
►►►Find me on Social Media◄◄◄
Follow What I am up to as it happens on

https://twitter.com/rebellionrider
https://www.facebook.com/imthebhardwaj
http://instagram.com/rebellionrider
https://plus.google.com/+Rebellionrider
http://in.linkedin.com/in/mannbhardwaj/
http://rebellionrider.tumblr.com/
http://www.pinterest.com/rebellionrider/

You can also Email me at
for E-mail address please check About section

Please please LIKE and SHARE my videos it makes me happy.
Thanks for liking, commenting, sharing and watching more of our videos

This is Manish from RebellionRider.com
♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS

Comments

MONKEY D. LUFFY :D says:

set serveroutput on
declare
a boolean:=true;
b number:=0;
c number :=0;
begin
while a loop
b:=b+1;
c:=19*b;
dbms_output.put_line(’19 ‘||’ x ‘||b||’ =
if b =10 then
a:=false;
end if;
end loop;
dbms_output.put_line(‘outside loop’);
end;
/

mikko martin says:

–Multiplication with BOOLEAN;

declare
v_test boolean := true;
v_counter number := 0;
v_result number;
begin
while v_test loop
v_counter := v_counter +1;
v_result := 20 * v_counter;
dbms_output.put_line (’20 x’ || v_counter || ‘=’ || v_result);
if v_counter >=10 then
v_test := false;
end if;
end loop;
end;
/

AFIQ RUBIYAN says:

hi manish
my question is what is the use of boolean expression as a test condition in while loop

viki says:

set SERVEROUTPUT ON
declare
v_test boolean :=true;
v_counter number :=0;
v_result number;
v_constant constant number := 19;
begin
while v_test loop
v_result:= v_constant * v_counter;
v_counter:= v_counter +1;
dbms_output.put_line(v_constant || ‘x’ || v_counter || ‘=’|| v_result);
if v_counter =100 then
v_test :=false;
end if;
end loop;
dbms_output.put_line(‘Outside the loop’);
end;

S M says:

sir please make video on static and dynamic sql

Simmlex says:

You can save the IF part at the end if you switch it to
V_test := (v_counter < 10); The part inside the () is a true or false statement which will be false only when v_counter reaches or exceeds 10.

Supriyo Sinha says:

set SERVEROUTPUT ON;
cl scr;
DECLARE
a NUMBER:=&Enter_the_number;
b NUMBER:=0;
c NUMBER;
d boolean:=True;
BEGIN
while d loop
b:=b+1;
c:=a*b;
DBMS_OUTPUT.PUT_LINE(a||’X’||b||’=’||c);
if b=10 then
d:=false;
end if;
end loop;
end;

shra v says:

Hi Manish,

Please find the program for multiplication table of 8 till 12.

SET SERVEROUTPUT ON;
DECLARE
v_test BOOLEAN := TRUE;
v_counter NUMBER :=0;
v_result NUMBER;
BEGIN
WHILE v_test
LOOP
v_counter := v_counter + 1;
v_result := 8 * v_counter;
DBMS_OUTPUT.PUT_LINE(‘8’ || ‘*’ || v_counter || ‘=’ || v_result );

IF v_counter = 12 THEN
v_test := FALSE;
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE(‘DONE’);
END;

Vaibhav Patel says:

why r u initialize v_counter as a 1 insted of 0 becoj in simple loop u have used 0 insted of 1 totally confused

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles   Show Cars   Motorbikes   Scooters   Bicycles   Rims & Tires   Luxury BoatsFashion   Sunglasses   Luxury Watches   Luxury Purses   Jeans Wear   High Heels   Kinis Swimwear   Perfumes   Jewellery   Cosmetics   Shaving Helpers   Fashion Hats   Modeling TipsFooding   Chef Club   Fooding Helpers   Coktails & LiquorsSports   Sport Shoes   Fitness & Detox   Golf Gear   Racquets   Hiking & Trek Gear   Diving Equipment   Ski Gear   Snowboards   Surf Boards   Rollers & SkatesEntertainment   DIY Guides   Zik Instruments   Published Books   Music Albums   Cine Movies   Trading Helpers   Make Money   Fishing Equipment   Paintball Supplies   Trading Card Games   Telescopes   Knives   Vapes   GameplaysHigh Tech   Flat Screens   Tech Devices   Camera Lenses   Audio HiFi   Printers   USB Devices   PC Hardware   Network Gear   Cloud Servers   Software Helpers   Programmer Helpers   Mobile Apps   Hearing AidsHome   Home Furniture   Home Appliances   Tools Workshop   Beddings   Floor Layings   Barbecues   Aquarium Gear   Safe Boxes   Office Supplies   Security Locks   Cleaning ProductsKids   Baby Strollers   Child Car Seats   Remote ControlledTravel   Luggages & Bags   Airlines Seats   Hotel Rooms   Fun Trips   Cruise Ships   Mexico Tours