Error on record insert with returning

123 views
Skip to first unread message

ricewi...@gmail.com

unread,
Jan 23, 2018, 4:43:31 AM1/23/18
to jOOQ User Group
Hello,

I've recently tried to create/insert a new record using jooQ.

Below is a sample of the code I've tried running.

Record record = dslContext.insertInto(IS_WINGS)
   
.set(IS_WINGS.BUILDING_PART, "TST")
   
.set(IS_WINGS.WING_DESCR, "Insert Test")
   
.returning(IS_WINGS.BUILDING_PART)
   
.fetchOne();


The table (IS_WINGS) and the columns are all verified to be valid. I am able to add new records via database applications (such as sql developer) using the same credentials as used for JooQ, meaning authentication or access rights aren't a problem. I was also able to add the record in the example by replacing .returning.... with .execute. As soon as I add the .returning, I get an exception.

The exception is as followed:
Caused by: java.sql.SQLSyntaxErrorException: ORA-04043: object "CORP" does not exist

"CORP" is the schema where the tables I'm using are located in and it obviously does exist.

The error showing the executed SQL is as followed:
Caused by: org.jooq.exception.DataAccessException: SQL [insert into "CORP"."IS_WINGS" ("BUILDING_PART", "WING_DESCR") values (?, ?)];

The strange thing is, this SQL is valid and works when entered through a database application. I am also able to perform any other actions (update, delete, etc) just fine.

The tables used (static variables in code) are generated by JooQ itself.


Any help on this issue would be greatly appreciated!




Lukas Eder

unread,
Jan 23, 2018, 5:31:50 AM1/23/18
to jooq...@googlegroups.com
Hello,

Thanks a lot for your message. I remember having seen a similar issue with INSERT .. RETURNING in Oracle, but cannot seem to find it right now. If I remember correctly, there was a bug in the ojdbc driver when using Statement.getGeneratedKeys(). May I ask you to provide:

- The Oracle server version
- The ojdbc driver version
- The jOOQ version

Thanks,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dennis19901

unread,
Jan 23, 2018, 6:49:19 AM1/23/18
to jOOQ User Group
Hello Lukas,

Thank you for your quick reply.

The versions I am using are listed below:
- The Oracle server version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
- The ojdbc driver version: 12.2.0.1
- The jOOQ version: 3.10.2

Op dinsdag 23 januari 2018 11:31:50 UTC+1 schreef Lukas Eder:
Lukas

To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.

Paul Hamer

unread,
Jan 24, 2018, 4:35:35 AM1/24/18
to jOOQ User Group
Hi Lukas,

Yes, that similar case was mine :-)
You advised me to specify Settings.renderSchema = false, which indeed solved my problem. I see, however, that this method is deprecated now.

Regads,
Paul
Reply all
Reply to author
Forward
0 new messages