您的位置:首页 > 数据库 > Oracle

在Oracle中使用序列创建唯一流水号

2008-05-15 11:17 316 查看
先创建序列;

create sequence SEQ_DJLSH
minvalue 1
maxvalue 9999999999
start with 1920
increment by 1
cache 20;

使用序列得到唯一流水号

create or replace procedure RF_G002_GETDJLSH(p_djlsh out t_djls.flowid%type) is
/*
得到单据流水号
ljg
2008-03-03
*/
v_flowid number(12, 0);
begin
select seq_djlsh.nextval into v_flowid from dual;
p_djlsh := v_flowid;
exception
when others then
p_djlsh := 0;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: