Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle 21c XE: alternate to DBMS_XSLPROCESSOR.CLOB2FILE

SmithJohn45Jul 17 2023 — edited Jul 17 2023

i was searching for how i can create large file (text file) of data ( selecting data from table(s) ) using UTL_FILE, during my search found some posts like;

https://forums.oracle.com/ords/apexds/post/write-more-than-32767-characters-with-utl-file-1699

here @solomon-yakobson answered and it was accepted, here he posted an effecient and simpler way to achieve the same as:

DECLARE
v_file_name VARCHAR2(200);
RESULT CLOB;
BEGIN
v_file_name:='Data_File'||'.txt';
SELECT FILE_CONTENT
INTO RESULT
FROM KALPATARU_CLOB;
dbms_xslprocessor.clob2file(RESULT,'EXT_TAB_DIR',v_file_name);
END;
/

when i searched for DBMS_XSLPROCESSOR.CLOB2FILE the official document says it has been deprecated:

https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_XSLPROCESSOR.html#GUID-24CDD0DC-5E23-4900-A680-A396C34107CE

so, is there any alternative to this procedure to write file in that simple way?

please help for a better way to write large data ( selecting data from table(s) ) in text file (can write more than default 32767), can help with links with examples.

regards

EDIT: DBMS_ADVISOR.CREATE_FILE can be an alternative to DBMS_XSLPROCESSOR.CLOB2FILE ?

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/arpls/DBMS_ADVISOR.html#GUID-6E4EB126-78C9-4D82-BE48-B1FEB5A2783E

This post has been answered by BluShadow on Jul 17 2023
Jump to Answer
Comments
Post Details
Added on Jul 17 2023
3 comments
837 views