My Oracle Support Banner

XMLCDATA SQL Function Fails with ORA-22835 for Strings > 4000 CHAR (Doc ID 1512017.1)

Last updated on APRIL 12, 2022

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.2 to 10.2.0.5.0 [Release 9.2 to 10.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

XMLCDATA SQL Function Fails with ORA-22835 for Strings > 4000 CHAR.

e.g.

SQL> declare
   mycdata clob;
   asxml   xmltype;
begin
   mycdata := lpad('X', 4000, 'X') || lpad('X', 4000, 'X');
   select xmlcdata(mycdata) into asxml from dual;
end;
/
declare
*
ERROR at line 1:
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 8000, maximum: 4000)
ORA-6512: at line 6

Changes

 

Cause

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
Symptoms
Changes
Cause
Solution
References


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