Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
$ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
pico, 948 is Java related and 566 makes me think that missjustme is working with Perl.
pico, 948 is Java related and 566 makes me think that missjustme is working with Perl.
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 ?
//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;
}
}
}
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