One Star

Problem in Inserting the XML

HI,
For the last two years I am using Talend. Now we have started using for archiving where the requirement is to insert XML in one column some of the xml fields to other columns. I am able to insert only XML with tWriteXMLField Component but not other columns.
Destination Table:
BANK_GROUP_CODE(Varchar2) --> value in BANK_GROUP_CODE element from the below has to go here
DEAL_ID(Varchar2) --> value in DEAL_ID element from the below has to go here
REG_TIMESTAMP (date) --> value in REG_TIMESTAMP element from the below has to go here
CONTENT (XMLTYPE) --> The whole element DEAL xml will go here
INPUT XML:
<root>
<DEAL>
<BANK_GROUP_CODE>ABC</BANK_GROUP_CODE>
<DEAL_ID>253999999999</DEAL_ID>
<STEP_ID>ISS</STEP_ID>
<REG_TIMESTAMP>03-06-2010</REG_TIMESTAMP>
<CONTENT>
<BANKGROUPCODE1>SCB</BANKGROUPCODE1>
<DEALID1>253999999999</DEALID1>
<STEPID1>ISS</STEPID1>
<REGTIMESTAMP1>03-06-2010</REGTIMESTAMP1>
</CONTENT>
</DEAL>
<DEAL>
<BANK_GROUP_CODE>BCD</BANK_GROUP_CODE>
<DEAL_ID>25311111111</DEAL_ID>
<STEP_ID>000</STEP_ID>
<REG_TIMESTAMP>03-06-2010</REG_TIMESTAMP>
<CONTENT>
<BANKGROUPCODE1>SCB</BANKGROUPCODE1>
<DEALID1>253111111111</DEALID1>
<STEPID1>000</STEPID1>
<REGTIMESTAMP1>03-06-2010</REGTIMESTAMP1>
</CONTENT>
</DEAL>
</root>
Can you please guide me the components which can solve my problem.
Please let me know if need more information.
Thanks in advance.
5 REPLIES
One Star

Re: Problem in Inserting the XML

Hi
You can create metadata "File XML" and follow the wizard by importing this XML file.
Then using tFileInputXml extracts all these nodes.
Regards,
Pedro
One Star

Re: Problem in Inserting the XML

Hi Pedro,
Thanks for your reply. My job design like the below
tFileInputXm-->tWriteXMLField-->tOracleoutput
To insert the xml i have used the tWriteXMLField but i am not able to retrieve other elements with this component.
One Star

Re: Problem in Inserting the XML

Hi
Why don't you use tXMLMap?
tFileInputXML-->tXMLMap-->tOracleOutput
Regards,
Pedro
One Star

Re: Problem in Inserting the XML

I am getting the below error when I have tried using the tXMLMAP
Execution failed :Failed to generate code.

Please help
One Star

Re: Problem in Inserting the XML

Hi
Uh...Failed to generate code again.
Recently there are many people who encounters this error.
I guess this may be due to tXMLMap.
Now delete the job and recreate it.
If the error occurs again, please report it at BugTracker.
Regards,
Pedro