0
我有一组pl/sql函数,都返回一个布尔类型。
我从另一个pl/sql函数中逐个调用这些函数。我想“积累”结果并从该函数中返回。plsql中的布尔运算
例如:
v_res boolean;
v_res2 boolean := true;
begin
v_res := f1('aa');
if v_res = false then
v_res2 := false;
end if;
v_res := f2('aa');
if v_res = false then
v_res2 := false;
end if;
-- some other calls to other functions
return v_res2;
end;
我想知道,我可以做在PL/SQL布尔运算?
我的意思是这样的:
v_res boolean := true;
begin
v_res := v_res * f1('aa');
v_res := v_res * f2('aa');
-- more calls to functions
return v_res;
end;
我想:
v_res := v_res * false;
和
v_res := v_res and false;
,但似乎工作是布尔转换为int的唯一的事情(我尝试与sys.diutil.bool_to_int)这不正确的感觉...
'v_res * false' - 您会因为这种奇怪的表情而期待什么? – zerkms
你最后一次尝试:'v_res:= v_res和f1('aa');' –
@TonyAndrews,你绝对正确!我不知道上次我检查了什么...... – Bassal