on ‎2007 Jun 05 2:48 AM
Hi I am trying to insert rows into a database. From all the rows in the source structure i will need to pick rows based on a source field, if the source field value matches a certain value 'WA' then that row needs to be mapped to the access structure of the target.
Request clarification before answering.
Vinay,
First of all read the file into XI.
Then you map your condition with createif to the root node of the target ie.,
Condition>createif>target root node.
So if the condition is true then only your target node will be created.
If this doesnot work due to multiple structures then another option I have is to do multiple mappings. So in the first mapping you send the whole row into XI. Then you parse it up and send the good records to the target. Then you in the second mapping you just map to the target.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vinay,
Can you give the sample source payload - structure.
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raj
Attached are the sample payloads i created to simulate my problem.
Source:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:test1 xmlns:ns0="urn:cop-city:test">
<row>
<parm1>C</parm1>
<parm2>1</parm2>
<parm3>10</parm3>
</row>
<row>
<parm1>A</parm1>
<parm2>2</parm2>
<parm3>20</parm3>
</row>
<row>
<parm1>Z</parm1>
<parm2>3</parm2>
<parm3>30</parm3>
</row>
<row>
<parm1>A</parm1>
<parm2>4</parm2>
<parm3>40</parm3>
</row>
</ns0:test1>
Result: after using satish's condition... Check if parm1 is equal to 'A' then createif.
But i had to change the context of parm1 to higher level.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:test2 xmlns:ns0="urn:cop-city:test">
<stmt>
<access>
<parm2>2</parm2>
<parm3>20</parm3>
</access>
<access>
<parm2>4</parm2>
<parm3>40</parm3>
</access>
</stmt>
</ns0:test2>
Satish thanks for thesuggestion.
Thats a good idea given bby Satish. Also, you might want to create UDF if things really seems to be clumsy in graphical tool (Assumption is you know the basic java for writing the UDF).
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.