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



Charles

I've just tried changing the return value from JDBC_GetCol() to 16Mb (my IDE was telling me that 65535 was the limit .. shows how old it is) but it saved and compiled ok. However it still only returns 32767 bytes of XML in the 16Mb field, which suggests that's all JDBC is returning. (statement result = r(str); in the JDBC_getCol() procedure listed below).
I downloaded the Microsoft JDBC Driver 4.0 for SQL Server last month, so maybe it's a bit behind the iSeries JRE 1.6.0
I'm not sure where to go from here ... but probably not a suitable post for an RPG forum ... unless anybody knows ?

Andy



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

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.


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

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.