编译后,如果有问题,用
show err查看是哪行出错和错误信息

解决方案 »

  1.   

    首先确定nrelationid,nbusinessid类型,若是字符型str:='insert into t_relate_ad_bus_'||ptype||'(id,nrelationid,nbusinessid,dcreatetime,dremovetime) values(SEQ_relate_ad_bus_'||ptype||'.nextval,'''||nbusinessid||''','''||nadminid||''',sysdate,to_date('30-12-9999','dd-mm-yyyy'))';若是数字型
    str:='insert into t_relate_ad_bus_'||ptype||'(id,nrelationid,nbusinessid,dcreatetime,dremovetime) values(SEQ_relate_ad_bus_'||ptype||'.nextval,'||nbusinessid||','||nadminid||',sysdate,to_date('30-12-9999','dd-mm-yyyy'))';
      

  2.   

    str:='select nparent from t_structure_admin where id='''||np||''''; 
    execute immediate str into nadminid ;
      

  3.   

    编译的时候不是这么出问题吧?
    好像是错误处理的那个地方(exception)有问题哦
      

  4.   

    在例外事件语句部分多加begin...end;
    exception     
    when no_data_found then  
      begin
      --语句;
      end;
    end;
      

  5.   

    问题解决了,不是那里的问题,是要在loop和end loop之间加begin 和 end 
    呵呵
      

  6.   

    奇怪了。
    loop
    begin
    ....
    exception     
    when no_data_found then  
    ....
    end;
    end;那多了一个end;