|
next
|
 Subject: Access To XML Query Question Author: mirko mehnert Date: 30 May 2006 08:03 AM
|
Hello,
I'm new to complex XML Applications and I've got a question, with hope, someone can give me a hint.
I've got a Database, with different tables.
let's say, there is a Table, with global METADATA and a table with PRODUCTS. METADATA contains some different Suppliers and PRODUCTS ... products.
The target XML should be like this:
<root>
<header>all METADATA from one ID</header>
<products>
<METADATA_ID>all Products, which have the called METADATA_ID</METADATA_ID>
<PRODUCTDATA />
</products>
</root>
that means, I need to build a DB2XML Query, which build a XML with all Databaseentries, which fit my request (over The METADATA_ID)
but how I handle this?
The METADATA contains one Dataset
PRODUCTS contains much more.
Should I do 2 Querys/DB2XML Files and join them in the final XML or should I write the same METADATA in each <row></row>
set of the DB2XML result like this:
(and query them again in the final XML to extract the METADATA in the header and the PRODUCTS into the cataloge part)
<root>
<row>
<METADATA_ID>1</METADATA>
<METADATA_NAME>something</METADATA>
<PRODUCTS_ID>10</PRODUCTS_ID>
<PRODUCTS_NAME>Test 10</PRODUCTS_NAME>
</row>
<row>
<METADATA_ID>1</METADATA>
<METADATA_NAME>something</METADATA>
<PRODUCTS_ID>21</PRODUCTS_ID>
<PRODUCTS_NAME>Test 21</PRODUCTS_NAME>
</row>
<row>
<METADATA_ID>1</METADATA>
<METADATA_NAME>something</METADATA>
<PRODUCTS_ID>44</PRODUCTS_ID>
<PRODUCTS_NAME>Test 44</PRODUCTS_NAME>
</row>
</root>
hope you understand this. my english is not so good.
thanks and best wishes
marcus
|
|
|
|