× 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.



Vern

For writing XML I've managed to live with the 32k field size limit, but reading XML written by someone else ... we have no control over what they send. We could read it in VB and export shortened XML ... but it's an extra process, and we like RPG.

Andy


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: 09 April 2013 13:55
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: 32767 limit

Andy

I've just begun looking at the new SQL XML programming manual - it speaks of XML data types can be up to 2GB.

I wonder if you need to use an XML locator. I'm trying to figure out ways to deal with XML for a project we have, and this is one direction I'm looking. For generating XML, actually. Will be looking at XML Extenders next. I already know CGIDEV2 can do it nicely.

But that's a bit OT - embedded SQL should now be able to process XML, to get the XML string - but how to deal with it? Someone else, please - help me! I need to learn, as well.

Vern

On 4/9/2013 6:55 AM, Andy Thompson wrote:
I want to receive the contents of an XML variable whose content exceeds 32767 bytes into an RPGLE program parse it and do some updates. The XML could potentially be 500k to 2GB. This is stored as an XML type field on an MSSQL table.

So .. I tried using JDBC in and RPGLE program using JNI. My attempt as shown below.
The program works fine when the content is less than 32767 but fails
on the XML-INTO when its bigger (RNX0353 reason 5)

Can anyone point me in the right direction ?

I should add we are running V7R1.

regards
Andy Thompson


D idata s sqltype(XML_DBCLOB:65535)

RS = JDBC_ExecPrepQry(PrepStm) ;
DoW (JDBC_NextRow(RS)) ;
iData = jdbc_getCol(RS : 1) ;
.
options = 'doc=string path=BOM/BO/OPOR/row ' +
'allowmissing=yes allowextra=yes case=any ns=remove';
xml-into rowOPOR %XML(%trim(iData) : options);
*** it Fails here because it truncates the XML at 32767 bytes ***
.

* Copyright (c) 2006-2008 Scott C. Klement
* All rights reserved.
P JDBC_GetCol B export
D JDBC_GetCol PI 32767A varying
D rs like(ResultSet)
D col 10I 0 value
D nullInd 1N options(*nopass:*omit)
D result s 32767A varying
D str s like(jstring)
D null s 1N inz(*OFF)
/free
jdbc_begin_object_group(5);
monitor;
str = getColString(rs: col);
if (str = *NULL);
result = '';
null = *ON;
else;
result = r(str);
endif;
on-error;
null = *ON;
result = '';
endmon;
jdbc_end_object_group();
if (%parms >= 3 and %addr(nullInd)<>*NULL);
nullInd = Null;
endif;
return result;
/end-free
P E



CONFIDENTIALITY NOTICE: This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under law. If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you received this in error, please contact the sender and delete the material from any computer.

We have taken precautions to minimise the risk of transmitting software viruses, however, you need to carry out your own virus checks on any attachments as we can take no responsibility for any computer virus transferred by way of this email.

All views or opinions expressed will be those of the author and not necessarily those of Harry Yearsley Ltd.

Harry Yearsley Ltd, Registered 556895, Registered Office : Yearsley
Group, Hareshill Road, Heywood, Lancs., OL10 2TP

Business is conducted as under our Terms and Conditions available on
request

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.

CONFIDENTIALITY NOTICE: This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under law. If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you received this in error, please contact the sender and delete the material from any computer.

We have taken precautions to minimise the risk of transmitting software viruses, however, you need to carry out your own virus checks on any attachments as we can take no responsibility for any computer virus transferred by way of this email.

All views or opinions expressed will be those of the author and not necessarily those of Harry Yearsley Ltd.

Harry Yearsley Ltd, Registered 556895, Registered Office : Yearsley Group, Hareshill Road, Heywood, Lancs., OL10 2TP

Business is conducted as under our Terms and Conditions available on request

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-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.