–新建序列
create sequence EAMS_APPSERIONO_SEQ
minvalue 0
maxvalue 999999
start with 1
increment by 1
cache 100;
–新建存储过程
create or replace procedure P_APPSERIONO_SQE_CLEAR is
mycount number(10);
begin
SELECT COUNT(*)
INTO mycount
FROM user_sequences
WHERE sequence_name = 'EAMS_APPSERIONO_SEQ';
if mycount > 0 then
execute immediate 'DROP SEQUENCE EAMS_APPSERIONO_SEQ';
execute immediate 'create sequence EAMS_APPSERIONO_SEQ
minvalue 1
maxvalue 999999
start with 1
increment by 1
cache 100';
else
execute immediate 'create sequence EAMS_APPSERIONO_SEQ
minvalue 1
maxvalue 999999
start with 1
increment by 1
cache 100';
end if;
end P_APPSERIONO_SQE_CLEAR;
最后每天开始定时任务。执行存储过程