Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have created a routine which takes an input row and convert it from sting to timestamp. When I use it in tjavarow everyting run smoothly, but when I am trying to call it inside tmap as string_to_timestamp.convert(row6.date) it throws an error : Exception in thread "main" java.lang.Error: Unresolved compilation problem:
package routines;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.LocalDateTime;
public class string_yyyyMMddHHmmss_to_timestamp
{
// arguments are passed using the text field below this editor
public static String timestamp_conversion(String input)
{
if(!input.equals("")) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern( "yyyyMMddHHmmss" );
LocalDateTime localDate = LocalDateTime.parse( input , formatter );
String return_date = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(localDate);
return return_date;
}else {
return input;
}
}
}
I call it inside tmap as : string_yyyyMMddHHmmss_to_timestamp.timestamp_conversion(row9.Call_Date_Time)
Click on the Code tab then in the right margin, click on the red rectangle to go directly where the error is and finally move the mouse over the red cross in the left margin to display the complete compilation error message.
You may also share more such as you routine method definition and the tMap expression where it is used else we can't guess what's the error.
package routines;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.LocalDateTime;
public class string_yyyyMMddHHmmss_to_timestamp
{
// arguments are passed using the text field below this editor
public static String timestamp_conversion(String input)
{
if(!input.equals("")) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern( "yyyyMMddHHmmss" );
LocalDateTime localDate = LocalDateTime.parse( input , formatter );
String return_date = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(localDate);
return return_date;
}else {
return input;
}
}
}
I call it inside tmap as : string_yyyyMMddHHmmss_to_timestamp.timestamp_conversion(row9.Call_Date_Time)
Somehow it stopped throw me an error now. I restarted the programm and everything runs ok.