- 论坛徽章:
- 0
|
为什么换了写法就不能输出值了?
过程1:
create or replace procedure pro_sel_totall(v_lingyu in varchar2,v_department in varchar2,n out number) is
begin
select count(*) into n from xuqiu_201301 t where t.xlingyu=v_lingyu and t.xdepartment=v_department;
end;
过程2:
create or replace procedure pro_tt as
a varchar2(222);
b varchar2(222);
c number;
begin
a:='信用卡';
b:='信用卡-信息技术部';
pro_sel_totall(a,b,c);
dbms_output.put_line(c);
end;
执行过程2,正确输出结果。
过程3:
create or replace procedure pro_tt2 as
a varchar2(222);
b varchar2(222);
c number;
begin
select t.xly_name into a from xyewu t where t.xid=27;
select t.xdep_name into b from xdepartment t where t.xid=10;
pro_sel_totall(a,b,c);
dbms_output.put_line(c);
end;
上面两个sql语句,得到的a和b的值,是跟过程2的一样的,只是换种形式,执行过程3,显示却是0,为什么啊?
跪等大神解答!!!
|
|