JOB循环?
JOB是个调用存储过程执行的东西,可以定义执行的时间,不过时间久了可能会时间不准
你那存储过程倒是不难写,你给个表名吧,还有要根据什么插数据
create or replace proc1 as
v integer;
begin
select count(*) into v from tab1;
if v>=10 then
del tab1;
end if;
insert into tab1(col1) values(val1);
end;
declare
a int;
begin
select count(*) into a from &tablename where rownum <= 11;--只要看是否有11天记录,不用全表统计
if a >=11 then
EXECUTE IMMEDIATE 'truncate table &tablename1';
else
insert /*+append*/ into &tablename1nologging
select * from &tablename;
commit;
end if;
end;
/
create or replace procedure sp_test(id in integer,value in varchar2) is --参数为待插入数据,可以多个
counts integer;
begin
select count(1) into counts from table_test;
if counts>9 then
delete from table_test;
commit;
end if;
insert into table_test(id,value) values(id,value);
commit;
end sp_test;