create or replace
function gen_next_seq(tab_name varchar2) return decimal is
pragma autonomous_transaction;
seq_no decimal;
begin
update seq_tab
set current_value = current_value + add_increment
where table_name = tab_name;
select current_value
into seq_no
from seq_tab
where table_name = tab_name;
commit;
return(seq_no);
end ;
表 seq_tab 记录各个表的最大主键