缺少异常处理
begin
 begin
   select goods_enname into goods_name from goods_dict where goods_id= goodid;
   select specs into goods_specs from goods_dict where goods_id= goodid;
 EXCEPTION WHEN NO_DATA_FOUND THEN
 dbms_output.put_line("no data")
end;
end;

解决方案 »

  1.   

    create or replace procedure des_update(
       goodid in varchar2)  
    as
       goods_name  varchar2(80);
       goods_specs varchar2(80);  
    begin
       select goods_enname into goods_name from goods_dict where goods_id= goodid;
       select specs into goods_specs from goods_dict where goods_id= goodid;
       if goods_name is null then
          goods_name:='NO description';
       end if;
       if goods_specs is null then
          goods_specs:='NO specs';
       end if;
       update contract_detail set description= goods_name||'/'||goods_specs  where goods_id= goodid;
    end des_update;