ASSERT_IS_NULL scalar function¶
Signals ASSERT_FAILED_STATE if A is a non-NULL value.
Prototypes¶
ASSERT_IS_NULL(A INTEGER)
ASSERT_IS_NULL(A DOUBLE)
ASSERT_IS_NULL(A TIMESTAMP)
ASSERT_IS_NULL(A TIME)
ASSERT_IS_NULL(A VARCHAR(4000))
RETURNS INTEGER
Description¶
Raises the ASSERT_FAILED_STATE state if A is not 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 NULL is arbitrary.
Parameters¶
- A
- The value to check for NULL.
Examples¶
Test an obvious failure:
VALUES ASSERT_IS_NULL(1);
1
-----------
SQL0438N Application raised error or warning with diagnostic text: "1 is
non-NULL". SQLSTATE=90001
Test that the DATE scalar function function returns NULL on NULL input:
VALUES ASSERT_IS_NULL(DATE(2000, 1, NULL));
1
-----------
0