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.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/1777fb0a-1ea9-4e37-ab1f-ded5eedfb8ddn%40googlegroups.com.

Reply via email to