Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all here,
I have similar issue while using for date column (but even after using relational.ISNULL / .equals(null)/ Length I am having null pointer exceptions )
*********************************************Coded as below *******
(row2.P_SPECL_BEG_DT1.equals(null) || row2.P_SPECL_END_DT1.equals(null)) || --------- > checking fro null column
(StringHandling.LEN(row2.P_SPECL_BEG_DT1.toString())==0 || StringHandling.LEN(row2.P_SPECL_END_DT1.toString())==0 ) ---> Checking if it is not null but o chars
? null :
!(TalendDate.isDate(row2.P_SPECL_BEG_DT1.toString(),"MM-dd-yyyy") && TalendDate.isDate(row2.P_SPECL_END_DT1.toString(),"MM-dd-yyyy"))? null : --->checking if it is not desired date
TalendDate.diffDate(row2.P_SPECL_END_DT1,row2.P_SPECL_BEG_DT1) < 0 ? " Error SPECL_BEG_DT1 > SPECL_END_DT1,"
:null
**************************** Please let me know why even after handling nulls I am having Null pointer exception *********** did I miss anything here ...
please correct my basic if I am missing any here
attaching sample date values for reference .... in which highlighted are null values coming and a 3 char word is another col in b/w which is not considered .
I'm not sure that I understand your requirements, but I do think you should try changing your code to (row2.P_SPECL_BEG_DT1==null || row2.P_SPECL_END_DT1==null) ? null
If your column is date datatype, blank values should return as null.
I'm not sure that I understand your requirements, but I do think you should try changing your code to (row2.P_SPECL_BEG_DT1==null || row2.P_SPECL_END_DT1==null) ? null
If your column is date datatype, blank values should return as null.