先创建序列;
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;