Skip to main content

NOT_NULL_OR_EMPTY

Description​

The not_null_or_empty function checks if the given value is neither NULL nor empty. It returns true if the input value is not NULL and not an empty string, otherwise, it returns false.

Syntax​

NOT_NULL_OR_EMPTY (<str>)

Parameters​

ParameterDescription
<str>The string to check

Return Value​

Returns false if the string is an empty string or NULL, otherwise returns true.

Examples​

select not_null_or_empty(null);
+-------------------------+
| not_null_or_empty(NULL) |
+-------------------------+
| 0 |
+-------------------------+
select not_null_or_empty("");
+-----------------------+
| not_null_or_empty('') |
+-----------------------+
| 0 |
+-----------------------+
select not_null_or_empty("a");
+------------------------+
| not_null_or_empty('a') |
+------------------------+
| 1 |
+------------------------+