oracle存储过程问题

[复制链接]
查看11 | 回复0 | 2009-6-23 10:16:42 | 显示全部楼层 |阅读模式
--按时间类型对bgorderinfo按照业务分类数据进行统计
CREATE OR REPLACE PROCEDURE IPS_BUSINESS_STATISTIC_PROC(businessKey IN varchar2,startTime IN date, statType IN varchar2,longTime IN INTEGER) AS


stime date;

etime date;

fail INTEGER;

totalc_ INTEGER;

mixc_ INTEGER;
BEGIN



-- 按小时

IF (statType = 1) THEN

stime :=to_date(to_char(startTime,'yyyy-mm-dd')||(to_char(startTime,'hh24')-1),'yyyy-mm-dd hh24');

etime :=to_date(to_char(startTime,'yyyy-mm-dd')||(to_char(startTime,'hh24')),'yyyy-mm-dd hh24');

DBMS_OUTPUT.PUT_LINE(to_char(stime,'yyyy-mm-dd hh24'));

END IF;



select count(business_key) totalc INTO totalc_ from ips_deal_bgorder_info where service_id='0000199999' and business_key=businessKey and ORDER_ACCEPTTIME>stime and ORDER_ACCEPTTIMEstime and ORDER_ACCEPTTIMEstime
and ORDER_ACCEPTTIME<etime;...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行