Four Stars

Creating SQL table from XSD file - containing all loops, and inserting XML's

Hi, 

I have a XSD file with a full schema, and I have daily XML files containing daily data. 
What I need to do is create a table in SQL with the XSD schema, containing all the loops in it and inserting into this table all the daily XML's data. 

What I did before and it didn't work was that I created the XSD schema but with the main loop only with tfileinputXML, and it brought me only one row at a time without separating the data to all the sub loops. 

 

Can anyone advise on this issue? Smiley Happy

 

Thanks, 

Gabrielle 

2 REPLIES
Moderator

Re: Creating SQL table from XSD file - containing all loops, and inserting XML's

Hello,

Could you please elaborate your case with an example with input and expected output values? Which will be helpful for us to understand your job requirement.

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.
Twelve Stars

Re: Creating SQL table from XSD file - containing all loops, and inserting XML's

I afraid, in any case - the final answer would be "this is not possible", there are many reasons for this:

- Talend not flexible for XML and JSON same as programming language (and this is not a drawback, this is just fact)

- Flat database table is not a best place for store XML (especial when structure could change and job must handle this structure changes)

 

so:
- in case if XML is stable - just create structure for all necessary tables  and define parsing for each loop. 

- store XML as XML, and use for parse XQuery provided by database (most of them today support this)
- store XML in XML database - MarkLogic, BaseX, eXists

-----------