Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

UTL_FILE.PUT writes txt over 32k ORA-29285: file write error

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The clob field in the table is generated into a txt file, and it is found that as long as it is written over 32k, an error will be reported.

Use UTL_FILE.PUT to write buffer to a file, but find that once a field exceeds 32K, the above ora06512 file write error is reported when it is just over 32k.

V_out_filename_full: = v_filedir_guid | | vested outdated file; v_file_handle: = UTL_FILE.FOPEN (v_outdir, v_out_filename, 'wicked page32767); pos: = 1; begin LOOP dbms_lob.read (v_clob_loc, amt, pos, buf) -- process contents of buf UTL_FILE.PUT (v_file_handle, buf); UTL_FILE.FFLUSH (file = > v_file_handle); pos: = pos + amt; END LOOP; EXCEPTION WHEN NO_DATA_FOUND then UTL_FILE.FCLOSE (v_file_handle); end

So try to change the write mode to wb byte mode and use UTL_FILE.PUT_RAW mode, and that's fine:

V_out_filename_full: = v_filedir_guid | | vested outbound file; v_file_handle: = UTL_FILE.FOPEN (v_outdir, v_out_filename, 'wb',32767)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report