我写了个基础的存储过程
CREATE OR REPLACE  PROCEDURE SYSTEM.AA 
( SG in char, b in number)
as
begin
   update system.hr_count
   set count=count+b
   where counterid=SG;
end;但调用总不成功
请各位大大指点~~
谢谢

解决方案 »

  1.   

    但调用总不成功
    --提示什么错误declare
    sg char(50);
    b number(10);
    begin
    sg:=;
    b:=;
    AA(sg,b);end;
      

  2.   

    CREATE OR REPLACE  PROCEDURE SYSTEM.AA 
    ( SG in char, b in number) as
    v_count     number  default   0;
    as
    begin
    v_count:=v_count+b;
       update system.hr_count
       set count=v_count
       where counterid=SG;
    end;
      

  3.   

    你没有作判断肯定不成功嘛,最好在update语句后面加上
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
       NULL;
      

  4.   

    如果用楼上的方法就要再加一个begin和end
      

  5.   

    EXCEPTION
    WHEN OTHERS THEN
    BEGIN
    DBMS_OUTPUT.PUT_LINE('OTHER ERROR='||SQLERRM);
    end;在里面补充上面的内容,就能看出来到底是什么错误了。