日期:2014-05-16 浏览次数:20497 次
CREATE OR REPLACE procedure AdjustSeqValue(pSeqName in varchar2,pValue in number) is
/******************************************************************************
将指定序列的值调整到指定的值,需要创建、删除序列的仅限。
******************************************************************************/
v_value number;
begin
begin
execute immediate 'drop sequence '||pSeqName;
exception
when others then null;
end;
if(pValue<0 or pValue is NULL) then v_value:=1;
else v_value:=pValue;
end if;
execute immediate 'CREATE SEQUENCE '||pSeqName || ' START WITH ' ||v_value|| ' INCREMENT BY 1 MINVALUE 1 MAXVALUE 999999 NOCACHE CYCLE' ;
end AdjustSeqValue;
/