I have a LOOP in my PL/SQL procedure which retrieves CLOB variables containing large chunks of text.
I would like that text to be added to a single OS file.
The amount of iterations (clob variables involved) is fairly large (1000) -in case it might be relevant-.
There are no performance requirements, simple and easy to read code is more relevant in this case.
Pseudocode:
output_file := UTL_FILE.FOPEN ('/tmp', 'output_file.txt', 'W');
FOR item
IN item_cursor
LOOP
my_clob := my_function_retrieves_the_next_clob();
Append my_clob to output_file <-- how?
END LOOP;
I am checking old threads and documentation and something as simple as that seems fairly complex.
Could someone suggest an easy way to achieve it?
Thanks,
P.D.: Oracle 11g r2 XE.