开发者

Get ID of last inserted record in oracle db

开发者 https://www.devze.com 2023-01-04 18:51 出处:网络
I want to retrieve the id of a newly inserted record with an auto incrementing id column (usi开发者_运维知识库ng the sequence and trigger method). What is the standard way to do this?Use the PL/SQL RE

I want to retrieve the id of a newly inserted record with an auto incrementing id column (usi开发者_运维知识库ng the sequence and trigger method). What is the standard way to do this?


Use the PL/SQL RETURNING clause:

insert into mytable (...) values (...)
returning id into v_id;
0

精彩评论

暂无评论...
验证码 换一张
取 消