3

I know in C like languages logical operators are evaluated one at a time so:

false && really_expensive_function()

is doesn't result in the function being called (I can't remember the CS name for this). Does the same happen in PL/SQL or do I need to break the IF parts out to separate blocks?

Chris
  • 2,447
  • 1
  • 21
  • 27

2 Answers2

7

The CS name is short-circuiting (wikipedia entry on short-circuit evaluation) and yes, plsql does exactly that.

ChristopheD
  • 112,638
  • 29
  • 165
  • 179
0

I think the term you are looking for is "lazy evaluation". You may want to look at this question.

Community
  • 1
  • 1
Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222