terça-feira, 16 de junho de 2009

Oracle Sequence

create sequence id
increment by 1
start with 15
maxvalue 999999999999999999
nocycle;

insert into tbl_TTTT (id, name)
values (id.nextval, 'ORACLE');

select id, name from tbl_TTTT
id name
-- -------
15 ORACLE

select id.currval from tbl_TTTT;
CURRVAL
---------
15

drop sequence id;