Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

How to get the last inserted Id for auto-generated column?

$
0
0

I have a table with an auto-generated primary key. I am connecting an ORM using ODBC and want the autogenerated id returned as part of the INSERT statement execution. Does HANA support this? What is the best way to do this? I am looking for ways to save on database roundtrip to get the PK value. The use case is a highly concurrent environment and every roundtrip we save, saves some resources. DB version: 1.0.101

eg:

create column table A

         (ID bigint not null primary key generated by default as IDENTITY,

          NAME nvarchar(30));

        

INSERT INTO A(name) VALUES('A name');


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>