My Oracle Support Banner

How to write large XML doc from XMLTYPE to an OS file (Doc ID 1567036.1)

Last updated on JANUARY 21, 2020

Applies to:

Oracle Database - Enterprise Edition - Version and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.


I have a requirement to export large xml files (couple of MB each file in a single write/put) from an XMLTYPE into an OS file.  I have tried the following but each one listed below has its own limitation on the number of characters per single write operation.

  1. UTL_FILE.PUT_RAW/PUT - Supports only less than 32676 characters.
  2. DBMS_XSLPROCESSOR.CLOB2FILE supports more than 32676 characters however the written file is chopped off around 50K.

How to get around the 50K limitation?


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.