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

NULL ON NULL INPUT

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

Just like stored functions, built-in functions have a NULL ON NULL INPUT characteristic, which allows for short circuiting function calls whose argument list contains at least one NULL value, knowing the result will be NULL as well. This transformation is available to jOOQ as well.

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

-- With Settings.transformPatternsNullOnNullInput active, this:
SELECT
  UPPER(NULL),
  LOWER(NULL),
  -- Many more
FROM tab;

-- ... is transformed into the equivalent expression:
SELECT
  NULL,
  NULL,
  -- Many more
FROM tab;

Feedback

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

The jOOQ Logo