sqlserver的@@IDENTITY在oracle中怎样实现

sqlserver的@@IDENTITY在oracle中怎样实现?

create sequence SEQ1
minvalue 1
maxvalue 99999999999
start with 1
increment by 1
cache 20;

begin
select seq1.nextval into idnum from dual;
select seq1.currval into idnum from dual;  ---应增加此条语句就可以了

insert into a(id,t1,t2) values(idnum,'a','b');
insert into b(t3,t4) values(idnum,'c');
end
posted @ 2005-06-22 23:53  eafy.ye  阅读(1020)  评论(1编辑  收藏  举报