Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can anyone say how to do validation for the below requirement?
Loading from excel to Oracle table.
In excel If date column is null or empty, I want to insert sys date into the oracle table.
Excel ---->tmap---> OracleOutput
in tmap source date column is Date type and Target date column is also Date type.
Hi All,
row1.CREATION_DATE == null? TalendDate.getCurrentDate(): row1.CREATION_DATE
this code is working fine for date type to date type.
But If I want to check empty it is not working:
row1.CREATION_DATE == " "? TalendDate.getCurrentDate(): row1.CREATION_DATE
Is it possible to check for empty?
This is the simplest way to handle nulls assuming you are getting dates in the proper format.
input_row.dateColumn==null||input_row.dateColumn.toString().trim().length()==0?TalendDate.getCurrentDate():input_row.dateColumn
In tMap use like below. Try either in variables or in the output column derivation.
DateCol==null?TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", TalendDate.getDate("yyyy-MM-dd HH:mm:ss"))ateCol
OR
DateCol==""?TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", TalendDate.getDate("yyyy-MM-dd HH:mm:ss"))ateCol
Thanks
Please add Variable in tMap
(row14.Date.equals("null") || row14.Date.equals(""))? TalendDate.getDate("yyyy-MM-dd") : row14.Date
Hi,
@ArvinRapt : Thank you! your method is working fine.
@rchinta and @SachinD as my data type for both source and target is DATE data type so your method is not working, maybe it works for string to string
Thanks to all.