CREATE OR REPLACE PROCEDURE WEBHALL_OWNER_USER.WB_mobile_active_cust_number
(
in_start_date IN varchar2, --开始时间
in_end_date IN varchar2, --结束时间
in_report_item in varchar2, -- 统计标示
o_report_value out varchar2, --统计项值
oi_errorFlag OUT number, --1正常 0异常
os_message OUT varchar2 --error Message
)
IS
-- 获得参数 event
vi_value number :=0;
vs_error_message varchar(300);
vi_is_error number:=0; --1正常 0异常
begin
-- 执行SQL
select count(distinct(f_service_id))
into vi_value
from wb_cust_contact_t
where f_contact_result = 1
and f_event = '14'
and f_service_kind = '8'
and f_stat_time>=TO_DATE (in_start_date, 'yyyy-mm-dd hh24:mi:ss')
and f_stat_time<=TO_DATE (in_end_date, 'yyyy-mm-dd hh24:mi:ss');
o_report_value := to_char(vi_value);
oi_errorFlag:=1;
exception
when others then
oi_errorFlag:=0;
os_message := SUBSTR(SQLERRM,1,200);
END WB_mobile_active_cust_number;
/
好久没有用存储过程了,这个存储过程怎么调用啊?
(
in_start_date IN varchar2, --开始时间
in_end_date IN varchar2, --结束时间
in_report_item in varchar2, -- 统计标示
o_report_value out varchar2, --统计项值
oi_errorFlag OUT number, --1正常 0异常
os_message OUT varchar2 --error Message
)
IS
-- 获得参数 event
vi_value number :=0;
vs_error_message varchar(300);
vi_is_error number:=0; --1正常 0异常
begin
-- 执行SQL
select count(distinct(f_service_id))
into vi_value
from wb_cust_contact_t
where f_contact_result = 1
and f_event = '14'
and f_service_kind = '8'
and f_stat_time>=TO_DATE (in_start_date, 'yyyy-mm-dd hh24:mi:ss')
and f_stat_time<=TO_DATE (in_end_date, 'yyyy-mm-dd hh24:mi:ss');
o_report_value := to_char(vi_value);
oi_errorFlag:=1;
exception
when others then
oi_errorFlag:=0;
os_message := SUBSTR(SQLERRM,1,200);
END WB_mobile_active_cust_number;
/
好久没有用存储过程了,这个存储过程怎么调用啊?
(
in_start_date, --开始时间
in_end_date, --结束时间
in_report_item ); -- 统计标示end;
/
outa varchar2(20);
outB number ;
outC varchar2(20);
begin
WB_mobile_active_cust_number(in_参数1,in_参数2,in_参数3,outa,outB,outC);
dbms_output.put_line('将你的输出的参数写入即可')
end;
outa varchar2(20);
outB number ;
outC varchar2(20);
begin
WB_mobile_active_cust_number('2011-01-01','2011-09-25','1',outa,outB,outC);
dbms_output.put_line(outa)
end;
这样写貌似有错啊!