create or replace procedure day_street_kh
is
yesterday varchar2(30);
maxTime varchar2(30);
myCusor SYS_REFCURSOR;
begin
--参数赋值
select to_char(sysdate - 1, 'yyyy-MM-dd') into yesterday from dual;
dbms_output.put_line(yesterday);
select max(t.ymtime) into maxTime from cr_exam_day_stats_bak t ;
dbms_output.put_line(maxTime);
--插入前删除cr_exam_day_stats 所有数据,
delete from cr_exam_day_stats t where t.typekind='1';
-- 删除存在的同一天数据
if(yesterday=maxTime)then
delete from cr_exam_day_stats_bak t where t.ymtime=yesterday and t.typekind='1';
end if;
--游标赋值
for myCusor in (
select
RAWTOHEX(SYS_GUID()) ID,
'' commname,
nvl(b.ymtime,yes
is
yesterday varchar2(30);
maxTime varchar2(30);
myCusor SYS_REFCURSOR;
begin
--参数赋值
select to_char(sysdate - 1, 'yyyy-MM-dd') into yesterday from dual;
dbms_output.put_line(yesterday);
select max(t.ymtime) into maxTime from cr_exam_day_stats_bak t ;
dbms_output.put_line(maxTime);
--插入前删除cr_exam_day_stats 所有数据,
delete from cr_exam_day_stats t where t.typekind='1';
-- 删除存在的同一天数据
if(yesterday=maxTime)then
delete from cr_exam_day_stats_bak t where t.ymtime=yesterday and t.typekind='1';
end if;
--游标赋值
for myCusor in (
select
RAWTOHEX(SYS_GUID()) ID,
'' commname,
nvl(b.ymtime,yes