Home >
database > Create a stored procedure, the reconstruction of the sequence, not perform reconstruction
Create a stored procedure, the reconstruction of the sequence, not perform reconstruction
Create a stored procedure, the reconstruction of the sequence, the stored procedure found that SEQ_2460H sequence is deleted, but without reconstruction, is what happened?
The create or replace procedure RebuildSeqH as
N_count number (8);
V_code NUMBER;
V_errm VARCHAR2 (64);
The begin
Select count (1)
Into n_count
The from user_sequences t
Where t.s equence_name='SEQ_2460H';
If n_count & gt; 0 then
The execute immediate 'drop sequence' | | 'SEQ_2460H';
End the if;
execute immediate 'create sequence' | | 'SEQ_2460H' | | 'minvalue maxvalue 999 start with 1 increment by 1 NOCYCLE cache 20'.
The exception
The when others then
V_code:=SQLCODE;
V_errm:=SUBSTR (SQLERRM, 1, 64);
DBMS_OUTPUT. PUT_LINE (' | | v_code | | ':' | |
V_errm);
end;