Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i am trying to copy data from sql server to oracle database.
i created same table in oracle. i created tmap. The problem is i am getting errors when copying date columns. if i ignore date columns data is copied properly.
The column in both sql and oracle database is date.
data in sql server is stored as YYYY-MM-DD.
Error is :
Starting job Limousine_sqlsrv_oracle at 13:29 13/04/2022.
[statistics] connecting to socket on port 3882
[statistics] connected
2022-04-13 13:29:31|6QHvSW|6QHvSW|6QHvSW|66824|TEST|Limousine_sqlsrv_oracle|_distwLsDEeytAen3XqwuhQ|0.1|Default||begin||
Exception in component tDBOutput_1 (Limousine_sqlsrv_oracle)
java.lang.ClassCastException: class java.sql.Timestamp cannot be cast to class java.sql.Date (java.sql.Timestamp and java.sql.Date are in module java.sql of loader 'platform')
at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2051)
at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2102)
at test.limousine_sqlsrv_oracle_0_1.Limousine_sqlsrv_oracle.tDBInput_1Process(Limousine_sqlsrv_oracle.java:2383)
at test.limousine_sqlsrv_oracle_0_1.Limousine_sqlsrv_oracle.runJobInTOS(Limousine_sqlsrv_oracle.java:6803)
at test.limousine_sqlsrv_oracle_0_1.Limousine_sqlsrv_oracle.main(Limousine_sqlsrv_oracle.java:6621)
2022-04-13 13:29:35|6QHvSW|6QHvSW|6QHvSW|TEST|Limousine_sqlsrv_oracle|Default|6|Java Exception|tDBOutput_1|java.lang.ClassCastException:class java.sql.Timestamp cannot be cast to class java.sql.Date (java.sql.Timestamp and java.sql.Date are in module java.sql of loader 'platform')|1
2022-04-13 13:29:35|6QHvSW|6QHvSW|6QHvSW|66824|TEST|Limousine_sqlsrv_oracle|_distwLsDEeytAen3XqwuhQ|0.1|Default||end|success|3859
[statistics] disconnected
Job Limousine_sqlsrv_oracle ended at 13:29 13/04/2022. [Exit code = 0]
i got the answer
In oracleOutput component -> advanced settings
uncheck checkbox against "Use Timestamp for Date types"
i got the answer
In oracleOutput component -> advanced settings
uncheck checkbox against "Use Timestamp for Date types"
if you want date in different format in tMap then use schema to mention desire output format. once you convert date, then change the output date format in schema column to "dd/MM/yyyy" Talend will do all the stuff for you. you don`t need to write anything else