I have start and end string , i want to first truncate the paragraph from start to end string (which is greater than 4000 cHARACTER). I used below but that works only with the number position but does not work with the string search. I know the error is because the string coming out is greater than 2000. If i restrict to 2000 then it works but my truncated string is around 19000 character length.
utl_raw.cast_to_varchar2(dbms_lob.substr(raw_data, 4005, 1))
ORA-06502: PL/SQL: numeric or value error: raw variable length too long