创建存储过程,重建sequence,不执行重建
创建存储过程,重建sequence, 这个存储过程发现,SEQ_2460H序列是删除了,但是没有重建,是咋回事?
create or replace procedure RebuildSeqH as
n_count number(8);
v_code NUMBER;
v_errm VARCHAR2(64);
begin
select count(1)
into n_count
from user_sequences t
where t.sequence_name = 'SEQ_2460H';
if n_count > 0 then
execute immediate 'drop sequence ' || 'SEQ_2460H';
end if;
execute immediate 'create sequence ' || 'SEQ_2460H' || ' minvalue 1 maxvalue 999 start with 1 increment by 1 NOCYCLE cache 20';
exception
when others then
v_code := SQLCODE;
v_errm := SUBSTR(SQLERRM, 1, 64);
DBMS_OUTPUT.PUT_LINE('' || v_code || ':' ||
v_errm);
end;