NULL-related functions and operators
The Null constant
| Function | HTSQL | SQL | Javascript | Python |
| The NULL constant | null() | value is NULL | null | None |
Signature: htsql:null() -> Untyped
In Javascript, there are two constants of null-ish kind: null and undefined.
Check if the value is NULL
| Function | HTSQL | SQL | Javascript | Python |
| Check if the value is NULL | is_null(value) | value IS NULL | value === null | value is None |
| Check if the value is not NULL | !is_null(value) | value IS NOT NULL | value !== null | value is not None |
Signature: htsql:is_null(Any value) -> Boolean
Type resolution: htsql:is_null(Untyped => String)
The function is_null(value) is equivalent to the expression value == null() (but not to value = null() as it will always produce NULL).
Note that in Javascript, value == null is also true if value is undefined.
Return non-NULL argument
| Function | HTSQL | SQL | Javascript | Python |
| Return the first non-NULL argument | coalesce(value1, value2, ...) | COALESCE(value1, value2, ...) | -- | -- |
Signature: htsql:coalesce(Any value1, Any value2[, ...]) -> Any
Type resolution: Every arguments must be of the same common type or be Untyped. All Untyped arguments are resolved to the common type. At least one non-Untyped argument should be present.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)