O'Reilly logo

Oracle PL/SQL For Dummies by Paul Dorsey, Michael Rosenblum

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Controlling Program Flow

In This Chapter

bullet Understanding control structures

bullet Setting up conditions

bullet Looping through commands

Every programming language has the ability to use logic to control what statements execute next. PL/SQL is no different in this regard. PL/SQL supports IF...THEN, CASE, and LOOP statements.

If you’re an experienced programmer, you can probably just skim this chapter for the PL/SQL-specific syntax. You won’t be missing anything important.

If you have studied programming only in school or are a novice programmer, you should probably read this chapter carefully to make sure that you understand all these structures.

To solve a programming problem, you can write programs by using one of two types of control structures:

bullet Conditional statements: In this case, the execution path is divided into branches depending upon the condition. If the condition is true, one path is followed; if false, a different path is used. These true or false conditions are called Boolean (meaning they can only have two states, such as on/off, yes/no, true/false) conditions.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required