My Oracle Support Banner

Dynamic Invocation of PLSQL Program with VARCHAR2 Parameter Length > 8K in Unicode DB Raises ORA-06502 (Doc ID 2822434.1)

Last updated on NOVEMBER 22, 2021

Applies to:

PL/SQL - Version 12.2.0.1 and later
Information in this document applies to any platform.

Symptoms

Dynamic invocation of PLSQL Procedure/Function with VARCHAR2 parameter(length > 8191) raises "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" in an Unicode DB(each character consumes upto 4 bytes) where NLS_LENGTH_SEMANTICS is set to 'CHAR'. Static invocation of the same PLSQL program works fine.

The behavior can be demonstrated using the following sample code.

The error is not observed when the procedure is invoked statically or the parameter is passed by reference(i.e. using NOCOPY option).

Changes

It's a newly installed database. No specific change was done.

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.