O'Reilly logo

Oracle PL/SQL Best Practices, 2nd Edition by Steven Feuerstein

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 5. Developer As Traffic Cop

There are many ways to conceptualize the job of a software programmer. One is that we sit around and play logic puzzles all day long—and get paid for it! Another is that we perform translation services between "normal people" and computers.

Yet another way to look at what we do is that we control the flow of data traffic between users and semiconductors. This is a very important job. If we let a chunk of data make a right turn when it should make a left turn—watch out! Someone could get fired when he or she should get promoted. A stock price could dive when it should rise slightly, and so on.

In this chapter I explore best practices related to the constructs that Oracle PL/SQL offers to control the flow of processing in your programs; these are presented in the following sections:

Best Practices for Conditional and Boolean Logic

Presents best practices for using the IF and CASE statements.

Best Practices for Loop Processing

Presents best practices for using FOR, WHILE, and simple loops.

Best Practices for Branching Logic

Presents best practices for using the GOTO and CONTINUE statements.

These constructs are relatively straightforward in syntax and usage. There are, however, several best practices you should take into account when you work with these kinds of statements.

Best Practices for Conditional and Boolean Logic

Follow the best practices in this section when you are using PL/SQL's IF and CASE statements. Ah, perhaps you didn't even know that PL/SQL ...

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