Search code examples
type-conversiontalend

String to Long conversion in Talend


I have an Excel input which I want to copy in SQL table. I am taking an input as a string and need to convert it in long to copy in SQL table.

My workflow is Excel input -> tMap -> tMSSqlOutput. I have used below expression for the conversion: row4.accesstype == null ? null : Long.parseLong(row4.accesstype)

But I am getting an error which says: java.lang.NumberFormatException: For input string: "accesstype_key1"

May I know where am I going wrong?


Solution

  • "accesstype_key1" is obviously not going to convert to a Long, it's a string. Check your input data.