PL/SQL Example for IF .. ELSIF

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    PL/SQL Example for IF .. ELSIF - Presentation 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!
    SlideShare Zeitgeist 2009

    + Kai Leung LiuKai Leung Liu Nominate

    custom

    123 views, 0 favs, 0 embeds more stats

    Design for Class to teach main points of IF .. ELSI more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 123
      • 123 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags