My Oracle Support Banner

ORA-06502 Or ORA-19011 Error Occurs When Executing extract(....).getstringval() (Doc ID 275339.1)

Last updated on SEPTEMBER 15, 2023

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 19.20.0.0.0 [Release 9.2 to 19]
Oracle Database Cloud Schema Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database 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

A query as shown below using the extract(...).getStringVal() function fails.

select extract(r.res, '/Resource/Contents').getStringVal()
from resource_view r
/

The query fails with an errormessage which depends on the database characterset used.
On a database having a single-byte characterset like WE8ISO8859P1 you get the error:

ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1

On a database having a multi-byte characterset like UTF8 you get the error:

ORA-19011: Character string buffer too small
ORA-06512: at "SYS.XMLTYPE", line 157
ORA-06512: at line 1

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!


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