Skip to Main Content

Appending several CLOB variables to a file

M.EmmanuelJun 26 2016 — edited Jun 26 2016

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.

This post has been answered by M.Emmanuel on Jun 26 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Jul 24 2016
Added on Jun 26 2016
3 comments
542 views