if xxx then if yyy then if zzz then -- do something end if; -- do something end if; -- do something end if;
这样平级的怎么写啊,大侠 if v_billtype=6 then if v_orgid=v_outorgid then select * from bd_emp; end if; if then select * from bd_emp; end if end if;
if 条件1 then 表达式 end if;if 条件1 then 表达式 elsif 条件2 then 表达式 elsif then 表达式 else 表达式 end if;
基本的语法回了,嵌套式一个道理。 if 条件 then if 条件 then if 条件 then end if; end if; end if;
把里面的句子改成 select 1 into 一个变量 from dual;再看看
if 表达式1 thenelsif 表达式2 thenelsif 表达式3 thenend if
if v_billtype=6 then if v_orgid=v_outorgid then execute immediate 'select * from bd_emp'; else execute immediate 'select * from bd_emp'; end if; end if;
if yyy then
if zzz then
-- do something
end if;
-- do something
end if;
-- do something
end if;
if v_billtype=6 then
if v_orgid=v_outorgid then
select * from bd_emp;
end if; if then
select * from bd_emp;
end if
end if;
表达式
end if;if 条件1 then
表达式
elsif 条件2 then
表达式
elsif then
表达式
else
表达式
end if;
if 条件 then
if 条件 then
if 条件 then
end if;
end if;
end if;
select 1 into 一个变量 from dual;再看看
if 表达式1 thenelsif 表达式2 thenelsif 表达式3 thenend if
if v_billtype=6 then
if v_orgid=v_outorgid then
execute immediate 'select * from bd_emp';
else
execute immediate 'select * from bd_emp';
end if;
end if;