O'Reilly logo

DB2® SQL PL: Essential Guide for DB2® UDB on Linux™, UNIX®, Windows®, i5/OS™, and z/OS®, Second Edition by Paul Yip, Fraser McArthur, Michael Gao, Raul Chong, Drew Bradstock, Clara Liu, Zamil Janmohamed

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. Using Flow of Control Statements

In this chapter, you will learn how to

  • Use the compound statement

  • Use labels in both compound statements and loops

  • Work with the two conditional statements (IF and CASE)

  • Implement the four looping statements (FOR, WHILE, REPEAT, and LOOP)

  • Implement the four transfer of control statements (GOTO, LEAVE, ITERATE, and RETURN)

Sequential execution is the most basic path that program execution can take. With this method, the program starts execution at the first line of the code, followed by the next, and continues until the final statement in the code has been executed. This approach works fine for very simple tasks but tends to lack usefulness because it can only handle one situation. Programs often need to be ...

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