PL/SQL tutorial 9: IF THEN ELSE (IF-ELSE) Statement in PL/SQL by Manish Sharma
Key Takeaways
Explains IF THEN ELSE Statement in PL/SQL with Examples
Full Transcript
what's up internet welcome back once again I'm Manish from Rebellion rider.com so the previous tutorial was all about simple if then statement in Oracle PL zq there we learn that simple if then statement enables us to specify the sequence of statements to be executed only if the condition is evaluated to be true in case this condition is evaluated to be false then no special action is to be taken except to proceed with the execution of the program to overcome this drawback in Oracle PL SQL we have if then else statement widely pronounced as if else statement with if then else in PL SQL we have two groups of executable statements one which gets executed if the condition is evaluated to be true and another group gets executed if the condition is evaluated to be false once the if then else construct gets completed the next statement right after if then else block is executed let's take a quick look at the syntax of if then else statement and here is the syntax as you can see if then else construct starts with the keyword if and ends with the reserve phrase and if which is very similar to the simple if then statement which we saw in the previous tutoria anyways followed by if keyword we have to specify a valid condition which will get evaluated if this condition is evaluated to be true then control is pass to the statement one and if this condition is evaluated to be false then control will jump over statement two once the construct is completed then statement three is executed hope this made the concept of if then else clear to you all if you still have any question or suggestion then feel free to leave a comment down below so now it's time to do some examples because they are the best way to understand the concept I think you all will agree with me on this so let's jump over SQL Developer and do some examples so we will start with a very simple example here in this example we will take a numeric input from the user and we'll check whether a user has entered an even number or an odd number using IF then else's statement this is going to be a very easy example for in the Declaration section of this block I have declared a variable Vore num with the data type number and using substitution operator I am taking values from the user next in the execution section of the block we have our if then else construct where we are checking whether the number entered by the user is even or odd for this test I have used mod function of Oracle Library as our if condition which will divide the first parameter by the second parameter and return return the remainder or say modulus if this modulus is zero then number will be even otherwise number will will be odd thus if the modulus comes as zero then control will jump over first dbms output statement and will print the given string but if modulus is not zero then control will jump over second dbms _ output statement and display its string once this is complete then control will come out from the if then else construct and will print the third dbms undor output statement so let's execute this PL SQL block and check the result my first input will be 20 and here is our result let's execute once again and this time let's take 25 as an input number 25 is odd and that is our result you can visit my blog and copy this example and try it by yourself link is in the description I'm always willing to learn new things from you guys so if you have any better example for if than else's statement in PL SQL demonstration then please feel free to comment or you can tweet me the screenshot of your code at Rebellion WR up with this I'll take your leave thanks for giving your time hope you enjoyed watching please give this video a thumbs up and share it on your social also don't forget to subscribe we'll see you soon with another tutorial till then take care this is Manish from Rebellion Rider
Original Description
3rd tutorial in the series explaining IF-THEN-ELSE statement in Oracle PL/SQL with Example. Enjoy
------------------------------------------------------------------------
►►►LINKS◄◄◄
Blog : https://www.rebellionrider.com/if-then-else-conditional-control-statement-in-pl-sql/
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
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Manish Sharma · Manish Sharma · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Oracle Database tutorials 1: How to install Oracle Database 11g on windows 7
Manish Sharma
Oracle Database tutorials 2:How To install SQL Developer on windows 7
Manish Sharma
Oracle Database tutorials 3:How to enable Line numbers in SQL Developer.
Manish Sharma
Oracle Database tutorials 4: database connectivity using SQL developer and command prompt
Manish Sharma
Oracle Database tutorials 5: how to Fetch Data using SELECT - SQL statement by Manish Sharma
Manish Sharma
Oracle Database11g tutorials 6 | | How to use Concatenation operator, character String
Manish Sharma
Oracle Database11g tutorials 7 | |SQL DISTINCT keyword || SQL tutorials
Manish Sharma
Canon EOS 600D 2 lens kit/Canon rebell EOS T3i 2 lens kit Unboxing
Manish Sharma
First look: ORACLE CERTIFIED ASSOCIATE (OCA) CERTIFICATE - ORACLE DATABASE ADMINISTRATOR
Manish Sharma
Oracle Database11g tutorials 8 || SQL DISTINCT with multiple columns |SQL Distinct with Two columns
Manish Sharma
Oracle Database11g tutorials 9 || What is archive log mode and how to enable archive log mode
Manish Sharma
Oracle Database11g tutorials 10 || SQL Single Row Function (SQL Functions )
Manish Sharma
Oracle Database11g tutorials 11: SQL case manipulation function in Oracle Database
Manish Sharma
how to add channel trailer and section on your youtube channel 2014
Manish Sharma
Oracle Database11g tutorials 12 || SQL Concat Function - SQL character manipulation function
Manish Sharma
Oracle Database11g tutorials 13 || SQL substr function / SQL substring function
Manish Sharma
Oracle Database11g tutorials 14 : How to CREATE TABLE using sql developer and command prompt
Manish Sharma
SQL tutorials 15 || How To CREATE TABLE using enterprise manager 11g
Manish Sharma
Oracle Database11g tutorials 16: How to uninstall oracle 11g from windows 7 64 bit
Manish Sharma
ORACLE CERTIFIED PROFESSIONAL(OCP) CERTIFICATE First look - ORACLE DATABASE ADMINISTRATOR
Manish Sharma
Plantronics audio 655 USB headset with Mic Unboxing and Review and Plantronics audio 655 Mic test
Manish Sharma
SQL tutorials 17: SQL Primary Key constraint, Drop primary Key
Manish Sharma
SQL tutorials 18: SQL Foreign Key Constraint By Manish Sharma
Manish Sharma
SQL tutorial 19: ON DELETE SET NULL clause of Foreign Key By Manish Sharma (RebellionRider)
Manish Sharma
SQL tutorials 20: On Delete Cascade Foreign Key By Manish Sharma (RebellionRider)
Manish Sharma
SQL tutorial 21: How To Rename Table in SQL using ALTER TABLE statement By Manish Sharma
Manish Sharma
SQL tutorial 22: How to Add / Delete column from an existing table using alter table
Manish Sharma
SQL tutorial 23: Rename and Modify Column Using Alter Table By Manish Sharma (RebellionRider)
Manish Sharma
SQL tutorial 24 :SQLJoins- Natural Join With ON and USING clause By Manish/Rebellionrider
Manish Sharma
Oracle Database11g tutorials 25: How to install Oracle Database 11g Express Edition R2 on Windows 7
Manish Sharma
SQL tutorial 26: Introduction to SQL Joins in Oracle Database
Manish Sharma
Vidcon 2014 YouTube Fan Funding: How to enable fan funding on YouTube Channel
Manish Sharma
SQL tutorial 27: Right Outer Join in SQL by Manish Sharma for RebellionRider
Manish Sharma
SQL tutorial 28: Left Outer Join By Manish Sharma / RebellionRider
Manish Sharma
SQL tutorial 29: Full Outer Join with example By Manish Sharma/ RebellionRider
Manish Sharma
SQL tutorial 30: Inner Join In SQL by Manish Sharma/RebellionRider
Manish Sharma
SQL tutorial 31 : SQL Cross Join In Oracle Database By Manish Sharma from RebellionRider
Manish Sharma
SQL tutorial 32: How To Insert Data into a Table Using SQL Developer
Manish Sharma
SQL tutorial 33:How To Insert Data into a Table Using SQL INSERT INTO dml statement
Manish Sharma
SQL tutorial 34: How to copy /Insert data into a table from another table using INSERT INTO SELECT
Manish Sharma
SQL tutorial 35: DELETE and TRUNCATE how to delete data from a table
Manish Sharma
SQL tutorial 36: how to create database using database configuration assistant DBCA
Manish Sharma
SQL tutorial 37: How to create NEW USER account using Create User statement in Oracle database
Manish Sharma
SQL tutorial 38: How to create user using SQL Developer in Oracle database
Manish Sharma
SQL tutorial 39: How to create user in oracle using Enterprise Manager
Manish Sharma
SQL tutorial 40: DBA Trick, How to drop a user when it is connected to the database
Manish Sharma
Motorola Moto G 2nd Generation / G2 Unboxing and Review
Manish Sharma
SQL tutorial 41: How to UNLOCK USER in oracle Database
Manish Sharma
SQL tutorial 42: How to Unlock user using SQL Developer By Manish Sharma RebellionRider
Manish Sharma
SQL tutorial 43: How to create an EXTERNAL USER in oracle database By Manish Sharma RebellionRider
Manish Sharma
SQL tutorial 44: How to import data from Microsoft Excel to Oracle Database using SQL Developer
Manish Sharma
SQL tutorial 45: Introduction to user Privileges in Oracle Database By Manish Sharma RebellionRider
Manish Sharma
SQL tutorial 46: What are System Privileges & How To Grant them using Data Control Language
Manish Sharma
SQL tutorial 47: How to Grant Object Privileges With Grant Option in Oracle Database
Manish Sharma
SQL tutorial 48: How to create Roles in Oracle Database
Manish Sharma
SQL tutorial 49: CASE - Simple Case Expression in Oracle Database (1/2)
Manish Sharma
SQL tutorial 50: CASE - Searched Case Expression In Oracle (2/2)
Manish Sharma
SQL tutorial 51: DECODE function in Oracle Database By Manish Sharma (RebellionRider)
Manish Sharma
Oracle Database Tutorial 52 : Data Pump expdp - How to Export full database using expdp
Manish Sharma
Oracle Database Tutorial 53 : Data pump expdp - How to Export tablespace in Oracle Database
Manish Sharma
More on: Database Integration
View skill →Related Reads
📰
📰
📰
📰
Unlock Your Potential: How AI & Automation Can Revolutionize Your Freelancing Hustle in Pakistan
Dev.to AI
AI Can Generate a SaaS Prototype. Building the Product Still Takes Months.
Dev.to · kai belmo
What Happens When OpenAI Goes Down and How to Stay Online
Dev.to AI
AI and the rise of the universal entertainment app
TechCrunch AI
🎓
Tutor Explanation
DeepCamp AI