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



While wrappers are nice as the make things simpler; the price you pay for
simplicity is less flexibility and accepting new limits.

You're going to need to write your own JDBC_GetCol() using Scott's as a
guide that handles results bigger than 32K.

RPGLE at 6.1+ allows for ~16MB. You could basically copy the existing proc
change the size of the return value and result variable and call it
JDBC_GetCol16MB()
or something. Be sure to pass your changes back to scott and he can
possibly incorporate them into the distribution. To make it easier, you
should probably wrap your new proc and prototype in an /IF DEFINED(*V6R1M0).

If that's not enough, you'd probably need to look at taking advantage of
teraspace.

Charles


On Tue, Apr 9, 2013 at 7:55 AM, Andy Thompson
<Andy.Thompson@xxxxxxxxxxxxxx>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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.