 --------------------------------------------------------------------------------- 
 FUNCTION get_next(i_search      IN VARCHAR2
                  ,i_modifier    IN VARCHAR2 DEFAULT 'i'
-                 ,i_raise_error IN BOOLEAN  DEFAULT FALSE ) return VARCHAR2 IS
+                 ,i_raise_error IN BOOLEAN  DEFAULT FALSE ) return CLOB IS
   l_node   ms_logger.node_typ := ms_logger.new_proc(g_package_name,'get_next');	
-  l_result varchar2(32000);
+  l_result CLOB;
 BEGIN
   check_timeout;
   ms_logger.param(l_node, 'i_search',i_search);

        AOP_block_body(i_level => i_level + 1);
      WHEN l_keyword = 'BEGIN' THEN
        AOP_block_body(i_level => i_level + 1);
      ELSE
	    ms_logger.fatal(l_node, 'Expected "DECLARE", "BEGIN", "END;"');
        RAISE x_invalid_keyword;
    END CASE;
 

	    if l_mystery_word in ('IF'
	                         ,'LOOP'
	    					 ,'CASE') then
		  g_code := REGEXP_REPLACE(g_code,l_mask,'\1 \2;',g_current_pos,1,'i');					 	 
		  go_past('END (\w+);');						 
		ELSE						 
	      ms_logger.info(l_node, 'Replacing '||l_end_value);
	      g_code := REGEXP_REPLACE(g_code,l_mask,'\1;',g_current_pos,1,'i');
		  go_past('END;');
	    end if;
 
	  END LOOP;
	end;  
   
  ms_logger.comment(l_node, 'Finised cleaning ENDs');

