以下是我的查询:
UPDATE DSOPI_PERSON_ADDR_RULE ADDR
SET ADDR.DEPT_NAME =
CASE
WHEN regexp_like (UPPER(addr.src_address_line1), 'DEP|DPT$|ABT|DIP.|DIPART|AFDEL|AVDEL|AVD.|DIV|PGRD|PGP|PPG')
AND ADDR.ORG_NAME IS NOT NULL
THEN ADDR.SRC_ADDRESS_LINE1
WHEN regexp_like (UPPER(addr.src_address_line2), 'DEP|DPT$|ABT|DIP.|DIPART|AFDEL|AVDEL|AVD.|DIV|PGRD|PGP|PPG')
AND ADDR.ORG_NAME IS NOT NULL
THEN ADDR.SRC_ADDRESS_LINE2
WHEN regexp_like (UPPER(addr.src_address_line3), 'DEP|DPT$|ABT|DIP.|DIPART|AFDEL|AVDEL|AVD.|DIV|PGRD|PGP|PPG')
AND ADDR.ORG_NAME IS NOT NULL
THEN ADDR.SRC_ADDRESS_LINE3
WHEN regexp_like (UPPER(addr.src_address_line4), 'DEP|DPT$|ABT|DIP.|DIPART|AFDEL|AVDEL|AVD.|DIV|PGRD|PGP|PPG')
AND ADDR.ORG_NAME IS NOT NULL
THEN ADDR.SRC_ADDRESS_LINE4
ELSE NULL
END;
我想做的是,当案例条件为真时,我想让相应的地址行为 NULL。有没有办法用这段代码实现它?