- 論壇徽章:
- 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:='信用卡-信息技術(shù)部';
pro_sel_totall(a,b,c);
dbms_output.put_line(c);
end;
執(zhí)行過程2,正確輸出結(jié)果。
過程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的一樣的,只是換種形式,執(zhí)行過程3,顯示卻是0,為什么?
跪等大神解答!!
|
|