I have the following block of PLSQL that succeeds when ln_length is 4000 characters or less but fails with "ORA-01460: unimplemented or unreasonable conversion requested" when ln_length is > 4000 characters.
The block is:
DECLARE
ls_string VARCHAR2(32767);
ls_temp VARCHAR2(32767);
ln_length NUMBER := 4000;
BEGIN
ls_string := '';
FOR i IN 1..ln_length LOOP
ls_string := ls_string || 'x';
END LOOP;
SELECT REPLACE(ls_string,'bob')
INTO ls_temp FROM dual;
END;
How would I write an equivalent piece of code that caters for strings up to 32k in length?