日期:2014-05-17  浏览次数:20695 次

存储过程问题请教
表结构:
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:并非所有变量都已绑定

请帮忙解决下!谢谢先!

------解决方案--------------------

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

------解决方案--------------------
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包含“:”
去掉即可。