因應跨年度,收據編號要歸0問題,須重建 sequence。
CREATE OR REPLACE PROCEDURE my_proc
IS
l_seq_start_with number := 0;
begin
begin
execute immediate 'DROP SEQUENCE MY_SEQ1';
exception
when others then null;
end;
execute immediate
'CREATE SEQUENCE MY_SEQ1 START WITH '
||to_char(l_seq_start_with)
||' INCREMENT BY 1 NOCACHE';
end;
沒有留言:
張貼留言