plsql - Can Oracle PL/SQL support short-circuit evaluation? -
given v_ssn_ind integer := if trim(p_ssn) null 0 else 1 end if;
i know can this: if v_ssn_ind=1 then…
but can short-circuit evaluation, ie: if v_ssn_ind then…
?
first off, talking not appear have short-circuit evaluation. short-circuit evaluation when code like
if( quick_condition , slow_condition ) <<do something>> end if;
evaluates second slow condition if , if initial quick condition evaluates true.
second, assignment of value v_ssn_ind
not syntactically valid.
third, no, cannot say
if <<integer variable>>
because not make sense. value evaluate true , value evaluate false? if 0 false , 1 true, example, 17 translate to?
if declaring sort of indicator variable, make sense use boolean
data type rather integer. if use boolean, can
if <<boolean variable>>
because eliminates ambiguity. won't faster adding = true
if condition however.
Comments
Post a Comment