Chinaunix首页 | 论坛 | 博客
  • 博客访问: 78957
  • 博文数量: 59
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 610
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-04 11:03
文章分类
文章存档

2010年(59)

我的朋友

分类: Oracle

2010-05-28 16:14:10

create or replace procedure webtongji IS
BEGIN
BEGIN
      INSERT INTO t_event_webtongji
    SELECT (SELECT COUNT(ID)
          FROM T_EVENT T
         WHERE EVENTSTATEID = 05
           AND T.C_CREATETIME BETWEEN
               (SELECT ((SYSDATE-1 - TO_DATE('19700101080000','YYYY-MM-DD HH24MISS')) * 24 * 60 * 60 * 1000) AS TIME
                  FROM DUAL) AND
               (SELECT (SYSDATE -
                       TO_DATE('19700101080000', 'YYYYMMDDHH24MISS')) * 24 * 60 * 60 * 1000 AS TIME
                  FROM DUAL)),
       (SELECT COUNT(ID)
          FROM T_EVENT T
         WHERE T.C_CREATETIME BETWEEN
               (SELECT ((SYSDATE-1 - TO_DATE('19700101080000','YYYY-MM-DD HH24MISS')) * 24 * 60 * 60 * 1000)  AS TIME
                  FROM DUAL) AND
               (SELECT (SYSDATE -
                       TO_DATE('19700101080000', 'YYYYMMDDHH24MISS')) * 24 * 60 * 60 * 1000 AS TIME
                  FROM DUAL)),
       (SELECT COUNT(ID) FROM T_EVENT T),
       ((SYSDATE - TO_DATE('19700101080000', 'YYYY-MM-DD HH24MISS')) * 24 * 60 * 60 * 1000)
  FROM DUAL;
 
  EXCEPTION
    WHEN OTHERS THEN
      ROLLBACK;
 END;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
    ROLLBACK;
end webtongji;
阅读(900) | 评论(0) | 转发(0) |
0

上一篇:plsql 学习

下一篇:6.2 外语学习

给主人留下些什么吧!~~