You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will result in the followind error: Expected one element, but found none
Expected would be to receive the newly inserted data. This works fine with jdbi and mssql. Also pgAdmin works correct when executing two statements in one go.
I also tried using a WITH statement for the insert. But the result is the same error.
Sidenote: While using the RETURNING keyword would work correct, as you can see, it won't be usable in this case.
The text was updated successfully, but these errors were encountered:
Hi @Mario-Eis , I think this is not a bug. The JDBC api does not guarantee that you can execute multiple SQL statements in one JDBC Statement with a ; - supporting that would be on a vendor-by-vendor basis.
In order to execute multiple statements in a cross-db compatible way, you would use either the Batch or Script api, or make multiple calls with a handle.inTransaction(txn -> txn.createUpdate("INSERT ...").execute(); txn.createQuery("SELECT ...").one())
Consider the following query:
When executed like this:
It will result in the followind error:
Expected one element, but found none
Expected would be to receive the newly inserted data. This works fine with jdbi and mssql. Also pgAdmin works correct when executing two statements in one go.
I also tried using a WITH statement for the insert. But the result is the same error.
Sidenote: While using the RETURNING keyword would work correct, as you can see, it won't be usable in this case.
The text was updated successfully, but these errors were encountered: