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

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

Trivial case abbreviations

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

Case abbreviations like NULLIF() can be trivial, in case of which the function call can be removed.

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

-- With Settings.transformPatternsTrivialCaseAbbreviation active, this:
SELECT
  NVL(NULL, a),
  NULLIF(a, a),
  NULLIF(NULL, a),
  NULLIF(a, NULL)
FROM tab;

-- ... is transformed into the equivalent expression:
SELECT
  a,    -- NVL(NULL, a),
  NULL, -- NULLIF(a, a),
  NULL, -- NULLIF(NULL, a),
  a     -- NULLIF(a, NULL)
FROM tab;

Feedback

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

The jOOQ Logo