Logical PL / SQL statements evaluate the whole function

I know in C how languages ​​logical operators are evaluated one at a time, therefore:

false && really_expensive_function()

does not result in a function call (I cannot remember the CS name for this). Does the same thing happen in PL / SQL or do I need to split the IF parts to separate blocks?

+3
source share
2 answers

The name is CS short-circuiting( wikipedia entry for evaluating a short circuit ), and yes, plsql does just that.

+7
source

I think the term you are looking for is a "lazy assessment." You can look at this question .

0
source

Source: https://habr.com/ru/post/1736093/


All Articles