IS_NOT_NULL()
All functions > COMPARISON > IS_NOT_NULL()
Returns TRUE if the expression does NOT evaluate to NULL.
Signatures
Returns: TRUE or FALSE; these predicates do not return NULL themselves
IS_NOT_NULL(expr: T) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
expr | T | Yes | Expression that may be NULL |
Notes
- Opposite of IS NULL
- Only reliable way to test for non-NULL values
- Using
!= NULLalways returns NULL, not TRUE/FALSE - Works with any data type (scalars, ARRAY, ROW, etc.); optional
::typeafter the keyword must match the expression type when present - Never returns NULL itself - always Returns TRUE or FALSE
Related operators
Examples
IS_NOT_NULL — functional call (second arg is TYPE '…')
FeatureQL
SELECT
f1 := IS_NOT_NULL('x', TYPE 'VARCHAR'), -- Non-NULL string
f2 := IS_NOT_NULL(NULL::BIGINT, TYPE 'BIGINT') -- NULL is not non-NULL
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
IS_NOT_NULL — chained
FeatureQL
SELECT
f1 := ('x').IS_NOT_NULL(TYPE 'VARCHAR'), -- Dot form: receiver is the expression under test
f2 := (NULL::BIGINT).IS_NOT_NULL(TYPE 'BIGINT') -- Same semantics as the prefix call
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |