ASSERT_IS_NOT_NULL scalar function¶
Signals ASSERT_FAILED_STATE if A is NULL.
Prototypes¶
ASSERT_IS_NOT_NULL(A INTEGER)
ASSERT_IS_NOT_NULL(A DOUBLE)
ASSERT_IS_NOT_NULL(A TIMESTAMP)
ASSERT_IS_NOT_NULL(A TIME)
ASSERT_IS_NOT_NULL(A VARCHAR(4000))
RETURNS INTEGER
Description¶
Raises the ASSERT_FAILED_STATE state if A is NULL. The function is overloaded for most common types and generally should not need CASTs for usage. The return value in the case that the value is not NULL is arbitrary.
Parameters¶
- A
- The value to check for NULL.
Examples¶
Test an obvious tautology:
VALUES ASSERT_IS_NOT_NULL(1);
1
-----------
0
Test that the DATE scalar function function returns NULL on NULL input:
VALUES ASSERT_IS_NOT_NULL(DATE(2000, 1, NULL));
1
-----------
SQL0438N Application raised error or warning with diagnostic text: "Value
is NULL". SQLSTATE=90001