PL/SQL tutorial 9: IF THEN ELSE (IF-ELSE) Statement in PL/SQL

3rd tutorial in the series explaining IF-THEN-ELSE statement in Oracle PL/SQL with Example. Enjoy
————————————————————————
►►►LINKS◄◄◄
Blog : http://bit.ly/if-then-else
Previous Tutorial
► IF THEN Statement https://youtu.be/IWvuFD6eD30
————————————————————————-
►►►Let’s Get Free Uber Cab◄◄◄
Use Referral Code UberRebellionRider and get $20 free for your first ride.
————————————————————————-
►►►Help Me In Getting A Job◄◄◄

►Help Me In Getting A Good Job By Connecting With Me on My LinkedIn and Endorsing My Skills. All My Contact Info is Down Below. You Can Also Refer Me To Your Company
Thanks

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

Sheik Sulaiman says:

SET SERVEROUTPUT ON;
DECLARE
v_name VARCHAR2(10) := ‘&enter_the_name’;
v_pass VARCHAR2(8) := ‘&eneter_the_password’;
BEGIN
IF v_name := ‘Rebelion’ and v_pass := ‘rider’ THEN
DBMS_OUTPUT.PUT_LINE(‘THIS IS ADMIN’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘SORRY TRY AGAIN’);
END IF;
DBMS_OUTPUT.PUT_LINE(‘ADMIN CHECKING FINISH’);
END;
please check and tell this satement correct or wrong

troy raphael ablanida says:

Easy to understand, deserves subscription and likes

Namrata Satpute says:

very nice way of teaching…:)…Request you to please upload detail video on datatypes in PL/SQL.

ridheen says:

nice.. but i wanted to know about mod(v_num,2) = 0 and also how and wen we should use the symbol || ??? kindly reply or mail to ridheen@gmail.com

Venkatesh R says:

good tutorials

vilas patil says:

One question here — I have executed thePLSQL I am getting o/p with PLSQL snytax as well please suggest what is going wrong .

PLSQL:
set serveroutput on;
DECLARE
vnum NUMBER := Ν
BEGIN
if mod(vnum,2)=0 then
dbms_output.put_line(vnum || ‘is even’);
else
dbms_output.put_line(vnum || ‘is odd’);
end if;
dbms_output.put_line(‘End of if esle end if’);
END;
/

O/p is

old:DECLARE
vnum NUMBER := Ν
BEGIN
if mod(vnum,2)=0 then
dbms_output.put_line(vnum || ‘is even’);
else
dbms_output.put_line(vnum || ‘is odd’);
end if;
dbms_output.put_line(‘End of if esle end if’);
END;

new:DECLARE
vnum NUMBER := 14;
BEGIN
if mod(vnum,2)=0 then
dbms_output.put_line(vnum || ‘is even’);
else
dbms_output.put_line(vnum || ‘is odd’);
end if;
dbms_output.put_line(‘End of if esle end if’);
END;
14is even
End of if esle end if

PL/SQL procedure successfully completed.

why am getting the entire o/p instead of only expected one:?

Mohammad Azaruddin Jakkali says:

Hi ‘MANISH’ ‘AZAR’ here… Thank you very much for providing a structured flow of tutorials, i am enjoying a lot and learning new things… I have a request for you, can you please make some example on CONDITIONAL STATEMENTS with more statements within a loop..

rachna sharma says:

plz explain function,cursor topics as well.. in b/w i like how u teach.. really make me understand.. Thanks for nice tutorials..

tripti choudhary says:

don’t we need to define the data width of NUMBER type variable while declaration..??

Hemu Kalyandurga says:

Buddy can you do videos on cursors and collections.. Like the way you present things.. Its really easy to understand

Csaba Somogyi says:

&enter_a_number doesn’t work for me.
ORA-06550: line 2, column 18:
PLS-00103: Encountered the symbol “&” when expecting one of the following:
( – + case mod new not null

continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date

pipe

Gulzar siddique says:

declare
a number:=&x;
b number:=&y;
result number;
begin
result:=a+b;
if result between 10 and 99
dbms_output.put_line( result || ‘ is two digit number ‘);
else
dbms_output.put_line( result || ‘ is single digit number ‘);
end if;
end;

plz give me solution sir,

anchal therkar says:

sir ap be Jo link provide ki
hai that’s not opening..what should I do?

Saratkumar Kedarisetty says:

by useing if then else i want to update marks in a table….

Ahmed Musa Sule says:

NICE

hard reset says:

bro you are rocking in my college

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