以下是一个示例代码,目的是校验,属性字段FYBH的值的内容是否,包含了非字典中的内容,进行值域完整性检查。

SELECT *
FROM xa_zfzlfwpt.YW_HTXX h
WHERE NOT EXISTS (
SELECT 1
FROM (
SELECT TRIM(REGEXP_SUBSTR(‘,’ || h.FYBH || ‘,’, ‘(.*?,){1}’ || ‘[^,]+(,|$)’, 1, LEVEL)) AS fybh_value
FROM dual
CONNECT BY LEVEL <= REGEXP_COUNT(h.FYBH, ',') + 1
) subquery
WHERE subquery.fybh_value NOT IN (
SELECT d.code
FROM xa_dhcplat.sp_dict_val d
WHERE d.dict_id = ‘COST_INCLUD_BEAR’ AND d.VALID = ‘1’
)
) and h.fybh is not null and h.fybh!=’00’;