Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I need to get some fields from an Oracle DB which have type TIMESTAMP(6) and then load them into another database and table with nanosecons acuracy. Is theare any way to do this.
I have some thoughts about it. Patch tOracleInput and tOracleOutput components to make them using java.sql.Timestamp type.
Is it possible to do that by other means?
HI,
I think java.time in java 8 doesn't support nanosecond
Send me Love and Kudos
I'ts seems you can workaround with dbtype Timestamp and java Type Object.
Hello,
java.sql.Timestamp supports nanosecond for DB, that is a SUN workaround for JDBC, and the date format have to be "yyyy-mm-dd hh:mm:ss.[fff...]"
Since java.util.Date is used in Talend, the micros / nanosecond precision is not available. However some components might check if the incoming Object type is java.sql.Timestamp in which case the nanoseconds are available as well. For this to be leveraged the Object type should be selected in the schema definition, and the source / target components needs to support it.Experiments worth execution
Then the target database may or may not able to store the Timestamp part of the above examples, which combined with the timezone could lead to days shifting.
Possible Workarounds
Use Strings and see if the database or their driver can handle the transformation. With String what you see is what you have, no extra hidden information.
Convert between timezones using Java code in a tJavaRow
String pattern = "yyyy-MM-dd";
log.info(TalendDate.formatDate(pattern, input_row.startDate));
output_row.startDateUTC = TalendDate.parseDateInUTC("yyyy-MM-dd zzz", TalendDate.formatDate("yyyy-MM-dd", input_row.startDate)+" UTC");
Let us know if it helps.
Best regards
Sabrina