create or replace package my_package is
k_num number;
g_num number;
--type pmmerinf_cur is ref cursor;
function f_count_num(x_status in posmadm.pmmerinf.status%type)
return number;
procedure p_count_num(x_status in posmadm.pmmerinf.status%type,
out_num out number);
end;create or replace package body my_package is
function f_count_num(x_status in posmadm.pmmerinf.status%type)
return number as
out_number number;
begin
if x_status = '0' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
elsif x_status = '1' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
end if;
return(out_num);
end f_count_num;
procedure p_count_num(x_status in posmadm.pmmerinf.status%type,
out_num out number) as
begin
if x_status = '0' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
elsif x_status = '1' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
end if;
end p_count_num;
end my_package;Cursororacle存储过程
k_num number;
g_num number;
--type pmmerinf_cur is ref cursor;
function f_count_num(x_status in posmadm.pmmerinf.status%type)
return number;
procedure p_count_num(x_status in posmadm.pmmerinf.status%type,
out_num out number);
end;create or replace package body my_package is
function f_count_num(x_status in posmadm.pmmerinf.status%type)
return number as
out_number number;
begin
if x_status = '0' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
elsif x_status = '1' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
end if;
return(out_num);
end f_count_num;
procedure p_count_num(x_status in posmadm.pmmerinf.status%type,
out_num out number) as
begin
if x_status = '0' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
elsif x_status = '1' then
select count(*)
into out_num
from posmadm.pmmerinf
where status = x_status;
end if;
end p_count_num;
end my_package;Cursororacle存储过程
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货