Where possible (i.e. below 16Mb) wouldn't it be better to have SQL bring them into a VARCHAR? Why mess with lengths when the code can do it for you?


Jon Paris
Jon.Paris@xxxxxxxxxxxxxx



On Jun 5, 2026, at 3:15 PM, David Gibbs via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx> wrote:


On Jun 5, 2026, at 2:18 AM, Daniel Gross <daniel@xxxxxxxx> wrote:

If you want the content in RPG your best bet is to use a variable of SQLTYPE(CLOB:<size>). This results in a special data structure with a _LEN and _DATA subfield, that you can use from RPG. And the contents of your CLOB are fully copied into memory.

FWIW: I submitted an idea to allow the data and length subfields to be accessed more idiotically.

Instead of ‘clobfield_data’ and ‘clobfield_len’, the subfields would be qualified, clobfield.data & clobfield.len.

https://ideas.ibm.com/ideas/IBMI-I-4759

david

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.



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