ITeye博客

oracle 序列

simple_hui · 2010-03-10 14:24 · 数据库 · ORACLE · 数据库 · Markdown

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

查询序列
select seq_a.nextval from dual;

为每张表生成对应的序列

--创建存储过程
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;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。