The sequence is cleared early every morning, so that the sequence starts from 1 every day. job: www.2cto.com SQL code begin sys. dbms_job.submit (job =>: job, what => 'clearseq (''seq _ SN_ID ''); ', next_date => to_date ('16-10-2012 18:37:20 ', 'dd-mm-yyyy hh24: mi: ss'), interval => 'trunc (SYSDATE) + 1/24 + 1'); commit; end;/Stored Procedure Delete sequence, create a new sequence, but note that this method cannot be used for removing sequence from a stored procedure, because after a new sequence is deleted, the stored procedure must be re-compiled before it can be used. This method uses the SQL code create or replace procedure ClearSeq (seqName in varchar) as n_count number (8); v_ SQL varchar (500); v_code NUMBER; v_errm VARCHAR2 (64); -- mahongmin begin select count (1) into n_count from user_sequences t -- where t. sequence_name = 'seq _ SN_ID '; where t. sequence_name = seqName; if n_count> 0 then execute immediate 'drop sequence '| seqName; end if; v_ SQL: = 'create sequence '| seqName | 'minvalue 1 maxvalue 99999999 start with 1 increment by 1 NOCYCLE cache 20'; execute immediate v_ SQL; exception when others then v_code: = SQLCODE; v_errm: = SUBSTR (SQLERRM, 1, 64); DBMS_OUTPUT.PUT_LINE ('error code when sequence is reset '| v_code |': '| v_errm); end;