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;