[code] declare
a boolean;
begin
if a then
dbms_output.put_line('true');
else
dbms_output.put_line('false');
end if;
end;
[/code]
output is false.
a boolean;
begin
if a then
dbms_output.put_line('true');
else
dbms_output.put_line('false');
end if;
end;
[/code]
output is false.
本文通过一个简单的PL/SQL代码示例介绍了如何使用IF-THEN-ELSE语句来进行条件判断。示例中定义了一个布尔变量并根据其真假输出不同的结果。
572

被折叠的 条评论
为什么被折叠?



