×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




As to the SQL approach, XMLTABLE table function was introduced in V7R2, so far as I can tell.

Cheers
Vern

On 1/20/2025 8:30 AM, Dave wrote:
The SQL solution looked interesting at the beginning but I think it wasn't
an option for us on V7R3.

This was my first xml-into program and no one else in the shop has yet used
it. They were using a third party solution which they stopped paying for!
I started off without the %handler, then the client decided he may
occasionally send more than one data set in the same xml file. I added a
DIM(5) just in case, but the client sent 6 and the program no longer
worked. It was then that I realised I couldn't put more than DIM(6) on my
outermost table.

I added the handler for the innermost table which can't work because I
can't get the relation between the tables at different levels.

I have finally used the handler on the outermost table with a DIM reduced
to 2 and everything seems to work. For the moment.

Thanks all



Re: XML-INTO %HANDLER PATH

- *Subject*: Re: XML-INTO %HANDLER PATH
- *From*: Vern Hamberg <vhamberg@xxxxxxxxxxxxxxx>
- *Date*: Sun, 19 Jan 2025 20:59:52 -0600
- *Auth-sender*: vhamberg@xxxxxxxxxxxxxxx

------------------------------

Dave

This is definitely a situation where I suggest using SQL's XML support -
XMLTABLE, which lets you pretty easily flatten selected XML elements into
table rows - only the elements you are interested in.

Here's a link to an example -
https://www.rpgpgm.com/2018/07/getting-data-from-xml-file-using-sqlhtml

I know, Jon P, this isn't your favorite solution!

I find that XMLTABLE can look a lot like CREATE TABLE, with columns
defined with regular SQL data types, plus "path" specs for where each
element is located in the XML.

See if that article helps - if you need more, I can probably help, I give
a case study presentation about this.

Cheers
Vern

On 1/19/2025 7:12 PM, Charles Wilt wrote:

Actually, that "process in chunks" idea is not quite right...

Even with %handler and path being used, XML-INTO pukes at 1GB; with the
default UCS processing.

You can double that limit to 2GB by telling it to process the file as SBCS.

https://www.ibm.com/docs/en/i/7.5?topic=documents-limitations-xml-parser

There's been an idea out there for a while for IBM to increase the limit.
https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-1826

Charles


On Sun, Jan 19, 2025 at 3:50 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

Are you sure Dave?

If you are using %handler you are processing the xml in chunks of the size
you define - surely the size of parts within any given object is not going
to exceed 16mb is it?


Jon Paris
Jon.Paris@xxxxxxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.