表结构:
test(id number,value varchar2(10))存储过程:
create or replace procedure test_pro1(b out number,a in varchar2) is
begin
  select id into b from test where value=a;
end test_pro1;建立正确
但执行时报错,错误如下:
ORA-01008:并非所有变量都已绑定请帮忙解决下!谢谢先!

解决方案 »

  1.   


    没有发现错误
    执行如下:
    sql>  var b number;
    sql>exec test_pro1(:b,'111');
      

  2.   

    create or replace procedure test_pro1(b out number,a in varchar2) is
    begin
    select id into b from test where value=a;
    end test_pro1;
    ------------------------------
    你给出的procedure定义中不存在你说的错误
    应该是你定义时的sql包含“:”
    去掉即可。
      

  3.   


    答案正确,请问为什么非得先执行下var b number呢?
    谢谢!
      

  4.   

    因为你的b类型为out类型,得外面声明一个变量接受过程输出的结果,所以得定义一个与输出内容相匹配的变量,用来接受输出结果。