|
Not sure this will help but here's a link to a white paper on DB2 XML
support (take the white papers link and you'll see it).
ibm.biz/Bd4fFb
Doug Mack
Analytics Consultant, DB2 for i
IBM Systems Lab Services
Mobile: 360-481-1271
email: mackd@xxxxxxxxxx
twitter: @mckdrmoly
From: Charles Wilt <charles.wilt@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 04/22/2016 11:03 AM
Subject: Structured XML Generation using SQL
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
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.