Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Unable to solve the issue when incoming DATE value has null values while trying to save the final data in the target DB as DATE.
The source input column is date type and target output is also date type, & both incoming and outgoing values are from Oracle DB.
Case 1: When column is set as date in tDBInput and as string in Tmap
Source Data: Defined as Date type in Oracle DB
tDBInput --> columns is set as date type ( sample data in this column: 11-MAR-08 15:16:25 );
Tmap --> declared column as string type,; allow null check box is checked; and using the following expression:
Relational.ISNULL(row12.LAST_UPDATE_DATE) ? null : TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss",row12.LAST_UPDATE_DATE)
Target Data:
Defined as Date type in Oracle DB
This is the compilation error: The method parseDate(String, String) in the type TalendDate is not applicable for the arguments (String, Date)
Case 2: When column is set as date in both tDBInput and Tmap:
Tmap expression :
Relational.ISNULL(row12.AOG_CAT_LAST_UPDATE_DATE) ? null : row12.AOG_CAT_LAST_UPDATE_DATE
Run time error:
ava.sql.SQLException: Invalid conversion requested
at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor.java:420)
at oracle.jdbc.driver.T4CVarcharAccessor.getTimestamp(T4CVarcharAccessor.java:644)
at oracle.jdbc.driver.GeneratedStatement.getTimestamp(GeneratedStatement.java:360)
at oracle.jdbc.driver.GeneratedScrollableResultSet.getTimestamp(GeneratedScrollableResultSet.java:1008)
at routines.system.JDBCUtil.getDate(JDBCUtil.java:61)
----
----
Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
Could you let me know how to handle this?
-Thank you
@not specified not specified , you need to check the format of the data which you are getting from the source and that format you need to convert .check at the source side are you getting yyyy-mm-dd hh:mm:ss format.
Thanks,
Manohar