Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

CLOB: ORA-06502: PL/SQL: numeric or value error: character string buffer too small

4008784Jun 14 2019 — edited Jun 18 2019

Hi,

I am using a CLOB datatype to store dynamic SQL inside a procedure. I am assigning the dynamic SQL by concatenating other variables and some static text.

The total length of the dynamic SQL is greater than 32767 characters. This is working fine. However one of the variables used in concatenation will have value depending on a condition. So when this variable is having the value I am getting   6502 - character string buffer too small. The length of this variable text is just 630 characters even though we declared it with varchar2(32767).

I am confused why i am getting this error for just extra 630 characters. Without this variable, the dynamic SQL length is around 60000 characters.

Database: Oracle 11g

I can't post the code as it is confidential.

Psudo Code:

V_CLOB := 'Static text..' || V_COND || 'static text....' || V2 || 'static text....' || V3;

This post has been answered by _jum on Jun 14 2019
Jump to Answer
Comments
Post Details
Added on Jun 14 2019
16 comments
5,330 views