Tabular IQ
Back to Function Index

ISNULL()

Overview

ISNULL() checks if a value is NULL, returning TRUE if the value is NULL and FALSE otherwise. This function works with all data types and is essential for NULL value handling, data validation, and conditional logic in queries.

Function Format

ISNULL(value)

Return Value

ISNULL() returns a Boolean value (TRUE or FALSE)

Examples


ISNULL("123")                = FALSE  (non-null string)
ISNULL("ABC")                = FALSE  (non-null string)
ISNULL(NULL)                 = TRUE   (null value)
ISNULL(0)                    = FALSE  (non-null number)
ISNULL("")                   = FALSE  (empty string is not null)
ISNULL(DATE(2025, 1, 1))     = FALSE  (non-null date)
ISNULL(EMPTY_COLUMN)         = TRUE   (if column contains NULL)

Notes

  • Important behaviors:
    • Returns TRUE only for NULL values
    • Returns FALSE for all non-NULL values, including:
      • Empty strings ("")
      • Zero (0)
      • False
      • Empty dates
  • Common use cases include:
    • NULL value checking
    • Data validation
    • Conditional logic
    • Data cleaning
    • Error handling
  • The function can be used with any data type, including:
    • Character strings
    • Numbers
    • Dates
    • Booleans
    • Any other data type
  • This function is different from EMPTY() which checks for empty values, not just NULL values.
  • When used in WHERE clauses, it can help filter out or include NULL values.
  • Often used in combination with COALESCE() or NVL() to provide default values for NULL values.

See Also