Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have src XML file..
I am getting data for one column like..Int and String value,,i want to load the data in to table..the table column has string data type.
Source (str&int) Target(str)
235451562 235451562
63453635 63453635
jsysysfags jsysysfags
the above way i need to pass.
but i a, facing issue..like
if i parser to int then int will be the problem.
if i change to .toString() then String value will be the problem.
source by default taking input is integer.
Please suggest me for good solution.
Thank you.
@saivsr,while readig from source if you read as sting data type you will not get any error. So read as a sting data type from XMl file for the source column.
My source is XML, i read source as document,so it is reading this column as integer based on data.
@saivsr,in Source metadata/Schema,you can change integer to sting.
tFileInputXml
Basic settings >>Edit schema>>change the column type from integer to sting.
reading source XML reading data type as Document..so i con't change my data type.
@saivsr,can you post your job design?
@saivsr,if you are reading as Document,you can conevrt data type from Documnet to Sting in tXmlMap or tJavarow.
row1.col.toString()
pfa
Monohar,,i have tried many functions for this.
.toString(),
String.ValueOf()
,TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy"
TalendDate.formatDate("MM/dd/yyyy HH:mm:ss",TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy",row1.CREATED_ON))
Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM])=1?[row12.doc:/asx:abap/asx:values/TAB/item/USNAM]:Integer.parseInt([row12.doc:/asx:abap/asx:values/TAB/item/USNAM])
[row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()
Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM]=1)?[row12.doc:/asx:abap/asx:values/TAB/item/USNAM]:
Mathematical.INT([row12.doc:/asx:abap/asx:values/TAB/item/USNAM])
[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].equals(null)?"":Mathematical.NUM([row2.doc:/asx:abap/asx:values/TAB/item/USNAM])!=1?[row2.doc:/asx:abap/asx:values/TAB/item/USNAM]:[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()
[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].equals(null)?"":[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].length>0?[row2.doc:/asx:abap/asx:values/TAB/item/USNAM]:[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()
StringHandling.LEN([row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString())>0?[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim():[row2.doc:/asx:abap/asx:values/TAB/item/USNAM]
Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()==1)? [row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim():null
Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM]==1)? [row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim():[row12.doc:/asx:abap/asx:values/TAB/item/USNAM]
@saivsr,do you import XML tree structe for tXmlmap fro input section?
Yes Manohar