Hi Guys,
I bumped into the following problem:
I have the following code which Works correctly with MSSQL 2019:
Java part:
....
final Integer insertedRowId = this.jdbcTemplate.queryForObject(sqlInsertNew), args, argTypes, Integer.class)
final String sqlInsertNew = "INSERT INTO MyTable ( Name) OUTPUT INSERTED.Id VALUES (?);"
the part:
OUTPUT INSERTED.Id is NOt recognized by H2 :(
MyTable is Defined like below:
CREATE TABLE [dbo].[MyTable](
[Id] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
[Name] [nvarchar](100) NOT NULL
) ON [PRIMARY];
Question:
I desperately need a way to create a working H2 counterpart of the above query,
because I am NOT allowed to change the Java code :(
Can I somehow return the freshly inserted Id in H2, by modifying the Sql statement only?
Thanks for your help,
Elemér.