Incorrect "Comparison with NULL" Compiler Hint

When setting a field to NULL in a MERGE statement, it appears to incorrectly interprets the = as a comparison operator and generates a compiler hint "Comparison with NULL":

MERGE INTO hydro.address_cleanup ac
USING (SELECT DISTINCT aci.unique_id
FROM hydro.address_cleanup aci) x
ON (x.unique_id = ac.unique_id)
WHEN MATCHED THEN
UPDATE
SET ac.hydro_status = NULL;

Can get around the problem by using TRIM(' ') instead of NULL.
 
Back
Top