create or replace procedure pro_stat(s_zkzh in varchar2,i_dts out varchar2,i_ddts out varchar2) as
int1 number(16);
int2 number(16);
str_ksxz varchar2(1);
str_zqxz varchar2(1);
cursor c1 is select ksxz,zqxz from jsy_users where zkzh=s_zkzh;
c2 c1%rowtype;
begin
open c1;
int1:=0;
int2:=0;
loop
fetch c1 into c2;
exit when c1%notfound;
if c2.ksxz='A' or c2.ksxz='B' or c2.ksxz='C' or c2.ksxz='D' then
int1:=int1+1;
if c2.ksxz=c2.zqxz then
int2:=int2+1;
end if;
end if;
end loop;
close c1;
i_dts:=int1;
i_ddts:=int2;
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8020322/viewspace-220332/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8020322/viewspace-220332/