My Oracle Support Banner

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

Last updated on AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version to [Release 9.2 to 12.2]
Information in this document applies to any platform.
***Checked for relevance on 22-Jan-2013***


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


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.