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

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

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