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

  Рет қаралды 160,731

Manish Sharma

Manish Sharma

Күн бұрын

Пікірлер: 34
@vishalranjan2429
@vishalranjan2429 3 жыл бұрын
dude you are saviour
@Simmlex
@Simmlex 7 жыл бұрын
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.
@kashifihsan
@kashifihsan 7 жыл бұрын
YOU ARE RIGHT . I DID IT. v_counter := v_counter + 1; v_test := (v_counter < 10); DBMS_OUTPUT.PUT_LINE(v_counter);
@helpingustayfit
@helpingustayfit 3 жыл бұрын
With simple example you explain the concept very well. thank you Sir for awesome learning
@stephinstephen9598
@stephinstephen9598 5 жыл бұрын
Here is what you asked for, 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 := v_counter * 19; DBMS_OUTPUT.PUT_LINE(v_counter||' x '|| 19 ||' = '||v_result); IF v_counter =10 THEN v_test := FALSE; END IF; END LOOP; DBMS_OUTPUT.PUT_LINE('Outside the Loop'); END;
@delvenacquire9005
@delvenacquire9005 3 жыл бұрын
Instead of that if condition for terminate loop can we use exit when commend like EXIT WHEN v_counter >= 10; (Boolean program)
@shrav8426
@shrav8426 9 жыл бұрын
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;
@nithyalakshmim8087
@nithyalakshmim8087 4 жыл бұрын
set serveroutput on declare v_counter boolean:= true; v_num number:=0; v_res number; begin while v_counter loop v_num := v_num + 1; v_res := 19 * v_num; dbms_output.put_line(19||'X'||v_num||'='||v_res); if v_num>=10 then v_counter:=false; end if; end loop; end; / for multiplication table of 19 using a boolean expression
@Rebellionrider
@Rebellionrider 4 жыл бұрын
well done 👍
@nithyalakshmim8087
@nithyalakshmim8087 4 жыл бұрын
@@Rebellionrider 😊
@chanda_cartoon_handle
@chanda_cartoon_handle Жыл бұрын
Dear teacher, I have a problem with Boolean datatype v_test variable. I get message like this "v_test" must be declared. But I have declared it already. Could you help me?
@clearcoding3139
@clearcoding3139 7 жыл бұрын
Answer of the home work: SET SERVEROUTPUT ON; DECLARE V_NUMBER NUMBER := '&ENTER_NUMBER'; V_TEST BOOLEAN := TRUE; V_COUNTER NUMBER := 0; V_RESULT NUMBER; BEGIN WHILE V_TEST LOOP V_COUNTER := V_COUNTER + 1; V_RESULT := V_NUMBER * V_COUNTER; DBMS_OUTPUT.PUT_LINE(V_NUMBER||' X '||V_COUNTER||' = '||V_RESULT); IF V_COUNTER = 10 THEN V_TEST := FALSE; END IF; END LOOP; END; /
@ubaidchougule
@ubaidchougule 3 жыл бұрын
SET SERVEROUTPUT ON; DECLARE u_multiply BOOLEAN :=TRUE; u_counter NUMBER :=0; u_result NUMBER; BEGIN WHILE u_multiply LOOP u_counter:= u_counter +1; u_result :=16 * u_counter; DBMS_OUTPUT.PUT_LINE ('16'|| ' x '|| u_counter||' = '||u_result); IF u_counter >=10 THEN u_multiply :=FALSE; END IF; END LOOP; DBMS_OUTPUT.PUT_LINE ('LOOP ENDED.THANKS MANISH'); END; /
@sudhanshubaranwal6215
@sudhanshubaranwal6215 5 жыл бұрын
Hi Manish, I tried 'dbms_output.put_line' just before starting of while loop but i am getting an error. Can you help me with that why i am getting an error
@manishshaw2393
@manishshaw2393 5 жыл бұрын
Can anyone please tell me what is this IDE abd how to download it......nice explanation btw...thanks for making such videos✌️
@Rebellionrider
@Rebellionrider 5 жыл бұрын
Thank you so much. I am really glad that you enjoyed my videos. Your appreciation means a lot to me. Regarding IDE, I am using a free tool offered by Oracle itself, it’s called SQL Developer. Check out this video here I have explained how to download and configure it. Step 1: Download and setup SQL Developer kzbin.info/www/bejne/sJ3Md2uhjbugm6c Step 2: How To Connect Your Database With SQL Developer Oracle 11g - www.rebellionrider.com/how-to-make-new-database-connection-in-sql-developer-rebellionrider/ Oracle 12c - kzbin.info/www/bejne/qn2pm6qvfah4p80 Oracle 18c - kzbin.info/www/bejne/Z5jZf2R3a92hrrc Thanks and have a great day!
@maulikchaudhari9163
@maulikchaudhari9163 4 жыл бұрын
SIR, I HAVE CONPLETED SQL. SIR IS IT COMPLETE SYLLEBUS FOR PLSQL FOR FRESHERS INTERVIEW ...?? PLZ SUGGEST ME SIR
@Rebellionrider
@Rebellionrider 4 жыл бұрын
Yep this is the entire syllabus. Can't say anything about fresher interview but people from around the world messaged and commented that they got job after learning Oracle from this channel. Some even said that their interviewer asked the same question that I have listed down in my blogs. So, don't worry, learn from this channel and my blog (www.rebellionrider.com) and practice. All the best for your future 😊
@kumarkrori
@kumarkrori 4 жыл бұрын
Hi Manish, I am executing a package.sp from shell script. How do I use SERVEROUTPUT ON for DBMS_OUTPUT.PUT_LINE?..please help
@SM-qd5vw
@SM-qd5vw 8 жыл бұрын
sir please make video on static and dynamic sql
@monkeyd.luffyd6775
@monkeyd.luffyd6775 7 жыл бұрын
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; /
@afiqrubiyan6954
@afiqrubiyan6954 8 жыл бұрын
hi manish my question is what is the use of boolean expression as a test condition in while loop
@srajanjain2541
@srajanjain2541 4 жыл бұрын
I appreciate your efforts ... but please don't put banner of LIKE THIS VIDEO or SUSCRIBE in middle of your teaching its disturbs a lot and distracts focus and attention as you having very good PL/SQL series. You put them in end only like you do. We always like,share & subscribe your video as its fruitful...thanks...Wishing you will try to improve this problem in your future videos.
@DamaraskaArya
@DamaraskaArya 5 жыл бұрын
Is it can be debugged by without creating functions, proc or package?
@Vykycy
@Vykycy 7 жыл бұрын
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;
@NormalIssues
@NormalIssues 4 жыл бұрын
DECLARE v_counter NUMBER:=0; v_result NUMBER:=0; v_test BOOLEAN:= TRUE; BEGIN WHILE v_test LOOP v_counter := v_counter +1; v_result := 10*v_counter; DBMS_OUTPUT.PUT_LINE('10'||'x'||v_counter||'='||v_result); IF v_counter=10 THEN v_test:= FALSE; END IF; END LOOP; END; THANKS
@antonalmishev1784
@antonalmishev1784 2 жыл бұрын
set SERVEROUTPUT ON; DECLARE v_counterA number :=1; v_counterB number :=1; v_result number ; v_stop boolean:=true; BEGIN while v_stop LOOP v_result := v_counterB*v_counterB; DBMS_OUTPUT.PUT_LINE(v_counterA || ' x ' || v_counterB || ' = ' || v_result); v_counterA := v_counterA +1; v_counterB:=v_counterB+1; IF v_counterA = 10 then v_stop := false; END IF; END LOOP; DBMS_OUTPUT.PUT_LINE('OUTSITE FROM THE LOOP'); END;
@nadunsamarasinghe5592
@nadunsamarasinghe5592 Жыл бұрын
set serveroutput on; declare vcounter number :=1; vresult number; vtest boolean :=TRUE; begin while vcounter
@vaibhavpatel1892
@vaibhavpatel1892 8 жыл бұрын
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
@supriyosinha7800
@supriyosinha7800 7 жыл бұрын
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;
@kapilchaudhary688
@kapilchaudhary688 6 жыл бұрын
how to increse text size in sql developer ?
@Kapil1891
@Kapil1891 6 жыл бұрын
How to come out from infinity loop?
@gummadinagalakshmi4083
@gummadinagalakshmi4083 5 жыл бұрын
By using exit or exit when clause you can come out from infinity loop
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
you need to learn SQL RIGHT NOW!! (SQL Tutorial for Beginners)
24:25
NetworkChuck
Рет қаралды 1,7 МЛН
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 101 М.
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 2,2 МЛН
for and while Loops
6:49
Neso Academy
Рет қаралды 774 М.
Learn SQL In 60 Minutes
56:24
Web Dev Simplified
Рет қаралды 2,2 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41