强制获取序列下一个值/当前值(oracle函数)
时间:2021-07-01 10:21:17
帮助过:23人阅读
create or replace function get_seq_next (seq_name in varchar2) return number
is
seq_val number ;
begin
execute immediate ‘select ‘|| seq_name|| ‘.nextval from dual‘ into seq_val ;
return seq_val ;
end get_seq_next;
create or replace function get_seq_curr (seq_name in varchar2) return number
is
seq_val number ;
begin
execute immediate ‘select ‘|| seq_name|| ‘.currval from dual‘ into seq_val ;
return seq_val ;
end get_seq_curr;
版权声明:本文为博主原创文章,未经博主允许不得转载。
强制获取序列下一个值/当前值(oracle函数)
标签:序列 oracle 函数 elong