Process XML field from SQL Server Xform to PostgreSQL table

One Star md
One Star

Process XML field from SQL Server Xform to PostgreSQL table

Hi , 
We have XML  field from SQL server for one of our tables with  data look like ""<values><value>1182</value></values>"
But when we try to  map to  PostgreSQL tables to XML datatype , we didn't find any matching DB type neither in SQL server Input component(tMSSQLInput) nor in PostgreSQL output component(tPostgreSQLoutput).
We try to use "document" datatype but our source data is not in proper XML tree structure. so parsing is challenge
we can handle with String datatype-> VARCHAR .but Can someone please suggest some better way to handle as XML in Talend Big data Open Studio ??
thanks 
Milan 
Moderator

Re: Process XML field from SQL Server Xform to PostgreSQL table

Hi Milan,

PostgreSQL cannot parse the XML content and therefore you have to save it as text content(String).
You can use
String.valueOf(row1.yourDocument)

to convert the document into a String.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star md
One Star

Re: Process XML field from SQL Server Xform to PostgreSQL table

Thanks Sabrina for confirmation! I read XML field as string and load data to table using TEXT.
either solution works for me ..but bad to hear we dont have XML datatype in DI