Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Format with Talend

I use an Oracle Input Component and the table A associated has got a column with a Date format.
I want to dump the data of this table A in an other Oracle table B which contains exactly the same columns. I have just drawn a "main row" between the two Oracle components (input and output tables).
The problem is that in the table A, the dates have got a format like 'dd/mm/yy hh:mi:ss AM', but after the dump, in the table B, the dates have got the format 'dd/mm/yy'.
How can I keep the initial format of my dates ?
Labels (2)
16 Replies
Anonymous
Not applicable
Author

It is a known bug (948)
Best Regards
Anonymous
Not applicable
Author

pico, 948 is Java related and 566 makes me think that missjustme is working with Perl.
Anonymous
Not applicable
Author

Hi.
With Oracle I use a tPerl component as first step in my jobs to set the Oracle date format.
$ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';

This solves most of my date time format problems.
Anonymous
Not applicable
Author

pico, 948 is Java related and 566 makes me think that missjustme is working with Perl.

I am working with Java... But I thougt that even with Java, expressions (filter, ...) might be written with Perl... Is that right ?
Anonymous
Not applicable
Author

pico, 948 is Java related and 566 makes me think that missjustme is working with Perl.

I am working with Java... But I thougt that even with Java, expressions (filter, ...) might be written with Perl... Is that right ?
No, that's wrong. If you work with Java, you have to use Java expressions and methods.
Anonymous
Not applicable
Author

I use an Oracle Input Component and the table A associated has got a column with a Date format.
I want to dump the data of this table A in an other Oracle table B which contains exactly the same columns. I have just drawn a "main row" between the two Oracle components (input and output tables).
The problem is that in the table A, the dates have got a format like 'dd/mm/yy hh:mi:ss AM', but after the dump, in the table B, the dates have got the format 'dd/mm/yy'.
How can I keep the initial format of my dates ?

Thank you for your answer...
So how can I solve my problem with java ? 😞
Anonymous
Not applicable
Author

While waiting for v2.01, here is a workaround :
New Routine
//template routine Java
package routines;
import java.text.SimpleDateFormat;
public class MyRoutine {
public static java.util.Date convertString(String s, String pattern) {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
try {
return sdf.parse(s);
} catch (Exception pe) {
pe.printStackTrace();
return null;
}
}
}

In tOracleInput, replace type from Date to String (only in the tOracleInput)
add a Mapper between tOracleInput/tOracleOuput and in fill the date output with the following line
MyRoutine.convertString(row1.dateField, "yyyy-MM-dd hh:mm:ss.S")

Hope it will works.
Best Regards,
Mike
Anonymous
Not applicable
Author

While waiting for v2.01, here is a workaround :
New Routine
//template routine Java
package routines;
import java.text.SimpleDateFormat;
public class MyRoutine {
public static java.util.Date convertString(String s, String pattern) {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
try {
return sdf.parse(s);
} catch (Exception pe) {
pe.printStackTrace();
return null;
}
}
}

In tOracleInput, replace type from Date to String (only in the tOracleInput)
add a Mapper between tOracleInput/tOracleOuput and in fill the date output with the following line
MyRoutine.convertString(row1.dateField, "yyyy-MM-dd hh:mm:ss.S")

Hope it will works.
Best Regards,
Mike

I don't understand but it doesn't work...
When I use a tLogRow component, I can see that the date is complete :
-> I obtain this format : Tue Mar 27 11:37:52 CEST 2007
But then, when I try to substitute the tLogRow component by a tOracleOutput component, the date in my out table has got the format 27/03/07 !
Maybe the bug happens when the data are inserted in the database...
An idea ?
Anonymous
Not applicable
Author

Whatis your Date format in Oracle table B ?