Turned out the issue is the with the DBMS_OUTPUT.PUT_LINE, it wont accept more than 200 chars to print. So if you have a larger data to be printed using DBMS_OUTPUT.PUT_LINE, then break it down and print 200 chars at a time.
You can use following outputter to break down big variables.
PROCEDURE print_big_text(bigTextInput VARCHAR2)
IS
ln_maxChar NUMBER := 200;
ln_schar NUMBER;
bigText VARCHAR2(32767) := bigTextInput;
BEGIN
LOOP
EXIT WHEN bigText IS NULL;
ln_schar := INSTR(bigText, ' ', ln_maxChar);
-- Find first space
IF ln_schar = 0 THEN
ln_schar := ln_maxChar + 1;
END IF;
-- If no space, just print first 200
dbms_output.put_line( SUBSTR(bigText, 1, ln_schar - 1) );
-- Move text by ln_schar ahead
bigText := SUBSTR(bigText, ln_schar);
END LOOP;
END print_big_text;
No comments:
Post a Comment