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;
阅读(894) | 评论(0) | 转发(0) |