Hi Mark,

Currently, the PostgreSQL (and Firebird) specific RETURNING clause is
emulated in most SQL dialects through JDBC only, via the
Statement.getGeneratedKeys() method. This means that the translated SQL
string (when using the parser and re-rendering the SQL in another dialect)
is not technically correct, or let's say, complete. It implies that some
additional action be taken on the JDBC level. An exception to this is DB2,
which supports the SQL standard SELECT .. FROM FINAL TABLE (INSERT ..)
syntax.

Oracle also supports INSERT (or UPDATE, DELETE) .. RETURNING, in a similar
way as PostgreSQL, but only in the PL/SQL language, not the SQL language.
It is not possible to run such a query as an ordinary PreparedStatement,
only as a CallableStatement that wraps the INSERT .. RETURNING statement in
an anonymous block.

There is a pending feature request to improve this in Oracle:
https://github.com/jOOQ/jOOQ/issues/5863

There's also a request to support SQL Server's OUTPUT clause, which isn't
exactly the same thing as RETURNING, though:
https://github.com/jOOQ/jOOQ/issues/3263

I hope this helps,
Lukas

2018-04-25 10:05 GMT+02:00 <[email protected]>:

> Hi,
>
> if I put an INSERT RETURNING statement to the jOOQ Parser and convert it
> to the SQLDialect.ORACLE, the resulting statement comes without the
> RETURNING.
>
> Is there a way to emulate the RETURNING part with jOOQ?
>
> Greets Mark
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to