When I exported the results of a SQL query (against an Oracle database) to a flat file, I noticed Talend is changing the format for date fields.
SqlPlus output format (Format I would like the output to be):
20-MAR-09 06.20.00.000000 PM
Talend:
Fri Mar 20 18:20:00 MST 2009
I am using a tMap object and auto mapping the fields.
I tried the following for to go from a date to a date:
Attempt 1:
TalendDate.setDate(row2.CREATE_DATE, 01, "dd-MMM-yy HH:mm:ss.SSSS")
Attempt 2:
TalendDate.formatDate("dd-MMM-yy HH:mm:ss.SSSS", row2.CREATE_DATE)
Attempt 3:
TalendDate.formatDate("day MMM dd HH:mm:ss yyyy", TalendDate.parseDate("dd-MMM-yy HH.mm.ss.SSSS PM",row2.CREATE_DATE));
Error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method parseDate(String, String) in the type TalendDate is not applicable for the arguments (String, Date)
at myjob.tOracleInput_4Process(myjob.java:8776)
at myjob.runJobInTOS(myjob.java:11133)
at myjob.main(myjob.java:11049)
Job myjob ended at 16:02 14/09/2009.