Oracle 序列用法

创建序列
create sequence seq_a minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache;


查询序列
select seq_a.nextval from dual;

删除序列
drop sequence seq_a
为每张表生成对应的序列

--创建存储过程
create or replace procedure p_createseq(tablename in varchar2)
is
strsql varchar2(500);
begin
strsql:='create sequence seq_'||tablename||' minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache';
execute immediate strsql;
end p_createseq;
/

--调用存储过程、创建序列
exec p_createseq('t_cms_column');

你可能感兴趣的:(oracle,cms)