Cartesian product on NRDM

Hi,

I have a table with data in the following format:


ID | col1 | col2 | col3
------------------------
01 | abc | def | ghi
-----------------------
02 | jkl | mno | pqr
-----------------------

I need to send the above data to a webservice in the below format:


<table_root>
 <table>
  <ID>01</ID>
  <col1>abc</col1>
  <col2>def</col2>
  <col3>ghi</col3>
 </table>
 <table>
  <ID>02</ID>
  <col1>jkl</col1>
  <col2>mno</col2>
  <col3>pqr</col3>
 </table>
</table_root>  

For this, I have tried to build an NRDM query which looks something like this:


Query
-TABLE_ROOT
--TABLE
---ID
---COL1
---COL2
---COL3

This is giving me the correct result, but the table is apparently getting joined with itself and performing a cartesian product which is taking a lot of time. I should probably not be leaving the WHERE condition blank, but I’m not exactly sure what I should be putting here.

Can someone pelase help me resolve this?


graghu1986 (BOB member since 2016-10-03)

Solved my issue using the XML_Map transform. This transform was perfect for my particular usecase. Looks like I was trying to re-invent the wheel. :rotf:

Oh well, at least I learned something new. This article really helped me out.


graghu1986 (BOB member since 2016-10-03)

you can solve this if you additionally add a row generator with 1 row and connect to the same query.
Then set the FROM tab on root-level of the query to row generator and the FROM tab of sub-schema only to table.


barthodo :de: (BOB member since 2012-04-18)