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!

Flatten CASE abbreviations

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

The NVL or COALESCE CASE abbreviations can be nested, but this doesn't add any value or clarity to the query. Hence, we flatten them.

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

-- With Settings.transformPatternsFlattenCaseAbbreviation active, this:
  NVL(NVL(a, b), c),
  COALESCE(NVL(a, b), c, NVL(d, e))
  COALESCE(a, COALESCE(b, c, d), e)
FROM tab;

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

References to this page


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

The jOOQ Logo