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

相关文章:

  • 2022-12-23
  • 2021-09-19
  • 2021-10-17
  • 2021-10-18
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2021-11-25
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2021-12-15
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案