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

Re: How to FInd Last Iserted Row Id in Hana

$
0
0

Hi there,

 

by definition, records in a table don't have any natural order. No first, no last, all records are equal in this regard.

 

Also, "the last inserted row" doesn't make any sense in a multi-transaction environment if you're not actually running in isolation mode "SERIALIZABLE", which inherently means: lock-contention for writing and reading.

 

Another aspect of this requirement and your request to implement it is: you strive to base your implementation of application logic on details of a specific DBMS implementation.

That's not really clever.

 

If you need the "age" of a record in your application, then put it into your data model.

 

If you simply need to follow up on the "most current" record you could use a flag and make sure that your application updates it accordingly (maybe via an SQLScript update procedure).

 

Relying on thing like "ROWID" was never recommended on any DBMS platform and surely won't be on SAP HANA.

 

- Lars


Viewing all articles
Browse latest Browse all 9165

Trending Articles