I have a table (actually a view) with few varchar2 fields. Say,
v_report(id, name, profile_id, profile_name);
I need to collect id-groupped data into a string. So, I do:
'Name: ' || clobagg(DISTINCT name)
|| ' Profile_name: ' || clobagg(DISTINCT profile_name)
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 7680, maximum: 4000)
NOTE: initially posted as a Comment, but offered as an Answer now, since the OP has confirmed that this was, in fact, the problem.
So, are you able to create the
CLOBs in the first place (without concatenation)? If you are, then what you are missing is wrapping the literals (and any other
VARCHAR2 values you may have) within
to_clob(). Good luck!