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
I'm using Oracle database and I'm facing an issue when trying to retrieve the last generated ID via an insert statement.
Oracle provides the possibility to retrieve the auto-generated keys using the getGeneratedKeys() method.
I built the below query following the doobie documentation:
sql"insert into person (name, age) values ($name, $age)"
.update
.withUniqueGeneratedKeys[Long]("id")
Unfortunately, it doesn't work. I'm getting the following error: java.sql.SQLSyntaxErrorException: ORA-00931: missing identifier
However, if I rewrite the query as follows it works fine:
val sql = "insert into person (name, age) values ($name, $age)"
Update[(String, Int)](sql)
.withUniqueGeneratedKeys[Long]("id")(("Bob", 12))
I don't understand why the first query is failing. Is there any difference between the 2 queries ?
doobie version used: 0.12.1
The text was updated successfully, but these errors were encountered:
I'm using Oracle database and I'm facing an issue when trying to retrieve the last generated ID via an insert statement.
Oracle provides the possibility to retrieve the auto-generated keys using the
getGeneratedKeys()
method.I built the below query following the doobie documentation:
Unfortunately, it doesn't work. I'm getting the following error:
java.sql.SQLSyntaxErrorException: ORA-00931: missing identifier
However, if I rewrite the query as follows it works fine:
I don't understand why the first query is failing. Is there any difference between the 2 queries ?
doobie version used:
0.12.1
The text was updated successfully, but these errors were encountered: