Hi All,
I wrote a script that would evaluate a particular data field from a view to that of another table. The script is as follow:
SELECT DISTINCT
SIEBEL.FMS_VALIDATION_VIEW.ACCOUNT_NUMBER,
'ADDRESS',
-- FMS VALIDATION VIEW VALUE
CASE
WHEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
THEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null')
END AS SIEBEL_VALUE,
-- CX CC PARSE DIA TABLE VALUE
CASE
WHEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
THEN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
END AS DIA_VALUE
FROM SIEBEL.FMS_VALIDATION_VIEW,
SIEBEL.CX_CC_PARSE_DIA
WHERE SIEBEL.FMS_VALIDATION_VIEW.ACCOUNT_NUMBER = SIEBEL.CX_CC_PARSE_DIA.ACCOUNT_NUMBER
AND SIEBEL.FMS_VALIDATION_VIEW.WORKORDER_NUM = SIEBEL.CX_CC_PARSE_DIA.WORKORDER_NUM
AND NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
The problem that I'm encountering is that the results are being returned as:
ACCOUNT_NUMBER ADDRESS SIEBEL_VALUE DIA_VALUE
8255110110001478 ADDRESS 123 MAIN ST PO BOX 1
8255110110001478 ADDRESS PO BOX 1 123 MAIN ST
Creating a unique key would not help because I have to perform the same "unmatch" evaluation on all of the fields between the view and the table. Theoretically the street address and the po box is a match and should not be return in the values. I had though the NOT IN function would solve this problem, but it doesn't. I would appreciate any help. Thanks in advance.
Kublait
I wrote a script that would evaluate a particular data field from a view to that of another table. The script is as follow:
SELECT DISTINCT
SIEBEL.FMS_VALIDATION_VIEW.ACCOUNT_NUMBER,
'ADDRESS',
-- FMS VALIDATION VIEW VALUE
CASE
WHEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
THEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null')
END AS SIEBEL_VALUE,
-- CX CC PARSE DIA TABLE VALUE
CASE
WHEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
THEN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
END AS DIA_VALUE
FROM SIEBEL.FMS_VALIDATION_VIEW,
SIEBEL.CX_CC_PARSE_DIA
WHERE SIEBEL.FMS_VALIDATION_VIEW.ACCOUNT_NUMBER = SIEBEL.CX_CC_PARSE_DIA.ACCOUNT_NUMBER
AND SIEBEL.FMS_VALIDATION_VIEW.WORKORDER_NUM = SIEBEL.CX_CC_PARSE_DIA.WORKORDER_NUM
AND NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
The problem that I'm encountering is that the results are being returned as:
ACCOUNT_NUMBER ADDRESS SIEBEL_VALUE DIA_VALUE
8255110110001478 ADDRESS 123 MAIN ST PO BOX 1
8255110110001478 ADDRESS PO BOX 1 123 MAIN ST
Creating a unique key would not help because I have to perform the same "unmatch" evaluation on all of the fields between the view and the table. Theoretically the street address and the po box is a match and should not be return in the values. I had though the NOT IN function would solve this problem, but it doesn't. I would appreciate any help. Thanks in advance.
Kublait