Add functionality to SQL to use RETURN on insert statements. To return the value of whichever field is specified after the insert.
Can be useful when using SQL to insert records and you need the ID immediately without having to select it.
Thank you for submitting the idea. The status has been changed to "Future consideration".
We have considered adding support for a RETURNING clause to our SQL INSERT command, but despite the apparent simplicity, it requires significant changes across our drivers and as such it hasn't drifted up to the top of our priority list.
Note that in IRIS JDBC, this information is available using the standard getGeneratedKeys() method: https://docs.intersystems.com/iris20233/csp/docbook/Doc.View.cls?KEY=BJAVA_primer#BJAVA_primer_resultsets_insert
@Stefan Cronje, you have a comment on your idea. Please answer it to help your idea to be promoted.
Depending on how you are running SQL, you can access a special variable called %ROWID.
Via SQL there is a LAST_IDENTITY() function.
Examples of both here...https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_last_identity