Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
StringHandling.LEN("hello world!")
Relational.ISNULL("")
Relational.ISNULL(row1.yourField)?(0):(StringHandling.LEN(row1.yourField))
(StringHandling.TRIM(row1.yourField).equals(""))?(0):(StringHandling.LEN(row1.yourField))
Exception in component tMap_1
java.lang.NullPointerException
at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.tMSSqlInput_3Process(SQL_To_Blocking.java:3927)
at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.tMSSqlInput_4Process(SQL_To_Blocking.java:5203)
at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.runJobInTOS(SQL_To_Blocking.java:6242)
at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.main(SQL_To_Blocking.java:6099)
// ###############################
{ // start of Var scope
// ###############################
// # Vars tables
Var__tMap_1__Struct Var = Var__tMap_1;
Var.DOBLen = Relational.ISNULL(row5.DOB) ? (0)
: (StringHandling.LEN(row5.DOB));
Var.tDate = Relational.ISNULL(row5.APPROX_DATEOFBIRTH) ? (null)
: (TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.0",
row5.APPROX_DATEOFBIRTH));
// ###############################
// ###############################
// # Output tables
VRdobDay = null;
// # Output table : 'VRdobDay'
VRdobDay_tmp.Book_id = row5.Book_id;
VRdobDay_tmp.dobDay = Var.DOBLen <= 4 ? null //this is line 3927
: (Var.tDate == null ? (0) :
TalendDate.getPartOfDate("DAY_OF_MONTH",
Var.tDate));
VRdobDay_tmp.dobMonth = Var.DOBLen <= 4 ? null
: TalendDate.getPartOfDate("MONTH",
Var.tDate);
VRdobDay_tmp.dobYear = Var.DOBLen == 0 ? null
: TalendDate.getPartOfDate("YEAR",
Var.tDate);
VRdobDay = VRdobDay_tmp;
// ###############################
} //
just to get the idea ...
ex public static String manageNullDate(String DOB, Date APPROX_DATEOFBIRTH) {
if(DOB == null){
// put your default value
}
if(APPROX_DATEOFBIRTH == null){
// your code
}
else {
String partOf date = TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.0",APPROX_DATEOFBIRTH);
etc ....
}
}