On Nov 13, 10:32 pm, yuri.de...
The SQL VARCHAR2 size is limited to 4000 BYTES, and you are trying to
fit 4000 CHARS into it, which, depending on the CLOB encoding and
content, may occupy more than 4000 bytes (for example when the
encoding is UTF-8 or anything like that and content features national
characters.) Reduce the amount to 2000 chars and there's good chance
you will never see ORA-6502 from DBMS_LOB.SUBSTR() again. Reduce it to
1000 chars and you definitely will never see it.
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)