--创建存储过程



create or replace procedure seq_res_1 
is
v_sql varchar2(200);
n number;
begin
select seq_name.CURRVAL into n from dual;
v_sql:='alter sequence seq_name increment by -'||n||' minvalue 0';
execute immediate v_sql;
select seq_name.nextval into n from dual;
v_sql:='alter sequence seq_name increment by '||1||' minvalue 0';
execute immediate v_sql;
end seq_res_1;


--执行存储过程,使序列初始值变为0,步长变为1

call seq_res_1();​