Available in versions: Dev (3.20) | Latest (3.19) | 3.18

This is experimental functionality, and as such subject to change. Use at your own risk!

Unreachable DECODE clauses

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

When a DECODE functino contains unreachable arguments, we can remove them.

Using Settings.transformPatternsUnreachableDecodeClauses, the following transformations can be achieved:

-- With Settings.transformPatternsUnreachableDecodeClauses active, this:
SELECT
  DECODE(a, b, 1, c, 2, b, 3),
  DECODE(a, b, 1, c, 2, b, 3, 4)
FROM tab;

-- ... is transformed into the equivalent expression:
SELECT
  DECODE(a, b, 1, c, 2),
  DECODE(a, b, 1, c, 2, 4)
FROM tab;

References to this page

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo