Values returned as NULL into DbFit

38 views
Skip to first unread message

Kabilan Ganesan

unread,
Mar 20, 2020, 11:09:03 AM3/20/20
to dbfit
Hi All,

When query results are returned into DbFit, some values are shown/returned as 'null' even for Primary Key values. Hence the comparison fails. Please check the attached screenshots.
But when I query the DB directly, I can see the values as expected.

Issue is happening for 2 different fields. Both are different data type, but returned as null into DbFit.

1. IP.UNQ_ID_IN_SRC_STM - This is NVARCHAR2 type
2. IP.DATA_DT - This is DATE type

Can you please tell how we can we can handle and get the actual values into DbFit?



Code:

!include -seamless .1MappingTestSuiteDemo.2CustomerSuite

|set option|bind symbols|false|

!define OSQuery {!-

select IP.UNQ_ID_IN_SRC_STM,IP.DATA_DT,IP.SRC_DL, NULL as LEGAL_FORM
from OS_-!${dname}!-.IP partition(-!${os_partition_name}!-) IP
left join OS_-!${dname}!-.CL_X_IP_RLTNP IPR on IPR.IP_UNQ_ID_IN_SRC_STM = IP.UNQ_ID_IN_SRC_STM and IPR.CL_ID IN ('CST', 'FORMR_CST')
where IP.IP_TP_ID = 'INDIV'

-!}

!define DMQuery {!-

select CU.CUSTOMER_NUMBER,CU.DATA_DATE,CU.SRC_DL,CU.LEGAL_FORM from 
dm_kyc_fcrm.CUSTOMER subpartition (-!${dm_partition_name}!-) CU
left outer join OS_-!${dname}!-.IP partition(-!${os_partition_name}!-) IP on IP.UNQ_ID_IN_SRC_STM = CU.CUSTOMER_NUMBER 
where IP.IP_TP_ID = 'INDIV'

-!}


!|Store Query|${OSQuery}|OS|
!|Store Query|${DMQuery}|DM|
!|Compare Stored Queries|OS|DM|
|A_NUMBER|DATA_DATE?|SRC_DL?|EOD_BALANCE?|?|

NULL Values returned.JPG
DB Values for DbFit.jpg

Yavor Nikolov

unread,
Mar 21, 2020, 8:27:44 AM3/21/20
to dbfit
Hi Kabilan, could you try naming the query columns so that both queries match in terms of column titles.

Also if you have types which differ (I don't know is that the case or not) - try casting them to same type. E.g. - if CUSTOMER_NUMBER is NUMBER and UNQ_ID_IN_SRC_STM is NVARCHAR2: use either to to_number or to_nchar to unify the types.

--
You received this message because you are subscribed to the Google Groups "dbfit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbfit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dbfit/83bafaa1-e975-4329-a021-dd707520bcf7%40googlegroups.com.

Kabilan Ganesan

unread,
Mar 21, 2020, 9:55:52 AM3/21/20
to dbfit
Hi Yavor,

I made the mistake!! 
I forgot to change the column names under Compare Stored Queries on my code. If the column name is incorrect they are returned as NULL.

Also as you said 'Column Titles' are important too. When i changes all column title to match on both queries, it worked like charm.

Thank you very much for you help!! Keep helping and I appreciate it.

Regards,
Kabilan
To unsubscribe from this group and stop receiving emails from it, send an email to db...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages