if语句的用法我知道,if  XXX  then  XXXXX
end if;我要想嵌套该怎么写?就像java中的 
if (){
    if(){
       if(){
       }
    }
}求教

解决方案 »

  1.   

    if xxx then
      if yyy then
         if zzz then
            -- do something
         end if;
    -- do something
      end if;
    -- do something
    end if;
      

  2.   

    这样平级的怎么写啊,大侠
    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;
      

  3.   

    if 条件1 then
     表达式
    end if;if 条件1 then
     表达式
    elsif 条件2 then
     表达式
    elsif  then
     表达式
    else
     表达式
    end if;
      

  4.   

    基本的语法回了,嵌套式一个道理。
    if 条件 then
    if 条件 then
    if 条件 then
    end if;
    end if;
    end if;
      

  5.   

    把里面的句子改成
    select 1 into 一个变量 from dual;再看看
      

  6.   


    if 表达式1  thenelsif 表达式2 thenelsif 表达式3 thenend if
      

  7.   


    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;
      

  8.   

    语法错了select * into v_bd_emp from bd_emp