ORA-06502 at the time of dbms_lob.substr
SQL> select dbms_lob.getlength (billing_inventory) from tablea where dbms_lob.getlength (billing_inventory) > 8000;
DBMS_LOB.GETLENGTH(BILLING_INVENTORY)
-------------------------------------
8192
1 row selected.
SQL> SELECT DBMS_LOB.SUBSTR (billing_inventory, 4000, 1), DBMS_LOB.SUBSTR (billing_inventory, 8000, 4001) FROM tablea;
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1
Regards, ANirban