XQUERY for EMC XDB separate for loops return in results

24 Views Asked by At

For this table results display top of the results. For this table results display bottom of the results.

I tried a few ways, a join. But the join takes alternates table1 record
table2 record
table1 record
table2 record

I need
table1 record
table2 record
table2 record
table2 record

{
for $an in /db/table1/row
where  $an/ACCOUNT = "something"
return $an
}
{
for $a in /db/table2/row
where  $a/PAT_ACCT_NBR = "something"
return $a
}
results

$an here
$a here.
1

There are 1 best solutions below

0
wp78de On

If I understand you correctly you could simply query the tables as needed and combine them to put them in the desired order:

let $table1 := //db/table1/row/ACCOUNT/[text() = 'something']
let $table2 := //db/table2/row/PAT_ACCT_NBR/[text() = 'something']
return ($table1, $table2)

The XPath part is just a suggestion; use whatever works for you.