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

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

Flatten DECODE

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

The DECODE function can be nested. In some cases, however, that nesting is unnecessary. Hence, we flatten the function calls.

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

-- With Settings.transformPatternsFlattenDecode active, this:
  DECODE(a, b, c, DECODE(a, d, e)),
  DECODE(a, b, c, DECODE(a, d, e, f))
FROM tab;

-- ... is transformed into the equivalent expression:
  DECODE(a, b, c, d, e),
  DECODE(a, b, c, d, e, f)
FROM tab;


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

The jOOQ Logo