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



You can get at CLOBs in RPG if you use SQL for your file access. Unfortunately, the embedded SQL interface only lets you retrieve up to 65531 bytes from a CLOB into an RPG variable.... but that's better than the 32767 limit of a VARCHAR field.

Alternately, you can extract the contents of the CLOB into a stream file (in the IFS) where you can deal with the full CLOB using IFS APIs.

If you use CLI (instead of embedded SQL) you can read CLOB data into pointer, so you can use dynamic allocation to bypass the 64k limit. Or you can read it into a user space and do it that way...

But, LOB fields are definitely supported in RPG -- as long as you don't plan to use F-spec type I/O.


Jon Paris wrote:
On 8-Jan-08, at 6:19 PM, midrange-l-request@xxxxxxxxxxxx wrote:
Is there a data type besides VARCHAR in DB2/400 -or- DB2 for i5/OS (For
Trevor :-) ) that will let me store more than 32000 characters.

CLOBs are the only thing I can think of - but unless things have changed you can't actually get at them directly in RPG, so depending on how you intend to build the application...

I guess an SQL function could be written to retrieve the data in 32K chunks.


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.