× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ok, so I've never needed to use the new XML functions in DB2.

Until now. I've got a need for a data export that seems like it might be a
good fit for XML...

Basically, I need to dump invoice header & detail. But for each detail
line, there will be an additional sub query or two to provide some extra
info.

Example (manually created so pardon syntax errors)

<Invoice number="12345" date='2016-01-01'>
<line number="1">
<sku>456789</sku>
<upc>12345678901</upc>
<qty>12</qty>
<more_info>
<line>abcd</line>
<line>efgc</line>
</more_info>
</line>
<legal1>invoice legal verbiage 1</legal1>
<legal2>invoice legal verbiage 2</legal2>
</Invoice>

I suppose I could just use a set of .CSV files with "foreign keys" but
using XML would allow me to keep everything together.

So my questions to the experts:
Does this seem like a reasonable use of XML? Or am I asking for trouble?

Do you have links to good references for learning to use the XML
functionality in DB2 for i? I've looked at the SQL reference, and while
useful, I'd like something a bit more together and with more advanced
examples of putting it all together.

Lastly, once I build the XML...how do I get it saved into a text file the
IFS?

Thanks!
Charles

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.