Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

ORACLE PLSQL - Conditions

Loading...

Published in: Oracle Training
860 Views

This document provides information about various conditions in PL/SQL

Debarun S / Kolkata

10 years of teaching experience

Qualification: B.Tech

Teaches: Computer, Mathematics, Science, Chemistry, Computer Science, Physics, School Level Computer, Defence Exams, IBPS, Insurance Exams, SSC Exams

Contact this Tutor
  1. In this chapter, we will discuss conditions in PL/SQL. Decision-making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false. Following is the general form of a typical conditional (i.e., decision making) structure found in most of the programming languages condition If condition is true conditional code O If condition is false PL/SQL programming language provides following types of decision-making statements. Click the following links to check their detail. S.N0 1 2 3 4 Statement & Description IF - THEN statement The IF statement associates a condition with a sequence of statements enclosed by the keywords THEN and END IF. If the condition is true, the statements get executed and if the condition is false or NULL then the IF statement does nothing. IF-THEN-ELSE statement IF statement adds the keyword ELSE followed by an alternative sequence of statement. If the condition is false or NULL, then only the alternative sequence of statements get executed. It ensures that either of the sequence of statements is executed. IF-THEN-ELSIF statement It allows you to choose between several alternatives. Case statement
  2. Like the IF statement, the CASE statement selects one sequence of statements to execute. However, to select the sequence, the CASE statement uses a selector rather than multiple Boolean expressions. A selector is an expression whose value is used to select one of several alternatives. Searched CASE statement 5 The searched CASE statement has no selector, and it's WHEN clauses contain search conditions that yield Boolean values. nested IF-THEN-ELSE 6 You can use one IF-THEN or IF-THEN-ELSIE statement inside another IF-THEN or IF-THEN-ELSIE statement(s).