请问该怎样调用下面的存储过程呢
create or replace procedure proForce_Cert(
v_MonthValue in number,
v_CurrentMonthBatch out number
)
as
  begin
  select count(t.force_cert) into v_CurrentMonthBatch
  from t_goods_decl t
  where to_char(t.decl_date,'yyyy')=to_char(sysdate,'yyyy')
  and to_char(t.decl_date,'mm')=lpad(v_MonthValue,2,'0');
end;
这个存储过程我是在PL/SQL Developer下面写的,我尝试用
declare v_CurrentMonthBatch number;
call proForce_Cert(6,v_CurrentMonthBatch);
print v_CurrentMonthBatch;
去调用,发现会出错,请问究竟要怎样调用才没有问题呢?

解决方案 »

  1.   

    pl/sql command window:set serveroutput on;declare
     v_CurrentMonthBatch number;
    begin
     proForce_Cert(6,v_CurrentMonthBatch);
     dbms_output.put_line(v_CurrentMonthBatch);
    end;
    /
      

  2.   

    variable c number;
    exec proForce_Cert(5,:c);--v_MonthValue需要传入具体的值
    print :c;
      

  3.   

    pl/sql command window也可这样按命令行调用:var v_CurrentMonthBatch number;
    call proForce_Cert(6,:v_CurrentMonthBatch);
    print v_CurrentMonthBatch;
      

  4.   

    执行set serveroutput on;都会出错,大哥,我是在pl/sql developer工具下面执行的
      

  5.   

    declare
     v_CurrentMonthBatch number;
    begin
     proForce_Cert(6,v_CurrentMonthBatch);
     dbms_output.put_line(v_CurrentMonthBatch);
    end;