Your SlideShare is downloading. ×
0
PL/SQL Example for IF .. ELSIF
PL/SQL Example for IF .. ELSIF
PL/SQL Example for IF .. ELSIF
PL/SQL Example for IF .. ELSIF
PL/SQL Example for IF .. ELSIF
PL/SQL Example for IF .. ELSIF
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

PL/SQL Example for IF .. ELSIF

2,389

Published on

Design for Class to teach main points of IF .. ELSIF concepts.

Design for Class to teach main points of IF .. ELSIF concepts.

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,389
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. PL/SQL Example #1
    • Two types of conditional control in PL/SQL:
      • IF statements
      • ELSIF statements
  • 2. IF Example?
    • Procedure process_task (task_in IN INTEGER)
    • IS
    • BEGIN
    • IF task_in = 1 THEN
    • Task_line1;
    • END IF;
    • IF task_in = 2 THEN
    • Task_line2;
    • END IF;
    • IF task_in = 20 THEN
    • Task_line20;
    • END IF;
    • END;
  • 3. Rewrite!
    • Procedure process_task (task_in IN INTEGER)
    • IS
    • BEGIN
    • IF task_in = 1 THEN
    • Task_line1;
    • ELSIF task_in = 2 THEN
    • Task_line2;
    • ELSIF task_in = 20 THEN
    • Task_line20;
    • END IF;
    • END;
  • 4. ELSIF Statement
    • If one condition is TRUE, no others can be TRUE. ELSIF offers the most efficient implementation for processing mutually exclusive clauses. When one clause evaluates to TRUE, all subsequent classes are ignored.
  • 5. Good Points!
    • Use ELSIF with mutually exclusive clauses
    • Use IF…ELSIF only to test a single, simple condition.
    • Replace and simplify IF statements with Boolean expressions.
  • 6. Q&A
    • Use IF wisely?
    • Next Week Case.
    • Thank You!

×