I've the next function:

CREATE OR REPLACE FUNCTION GetVarchar2 (iclCLOB IN Nvarchar2)
return NVARCHAR2
IS
cnuMAX_LENGTH Constant number := 32767 ;
nuLength Number := DBMS_LOB.getlength(iclCLOB);
sbBuffer Nvarchar2(32767);
begin
dbms_lob.read(iclCLOB,nuLength,1,sbBuffer);
return sbBuffer;
END;

after i refer to it as such as this:

select GetVarChar2(text) from posts where postid = 'anId';

I recieve this error:

ORA-22835: Buffer not big enough for CLOB to CHAR or BLOB to RAW conversion (actual: 6058, maximum: 2000)
22835. 00000 - "Buffer not big enough for CLOB to CHAR or BLOB to RAW conversion (actual: %s, maximum: %s)"
*Cause: An effort is made to transform CLOB to CHAR or BLOB to RAW, where
the LOB size was larger than the buffer limit for CHAR and RAW
types.
Observe that sizes are reported in figures if character length semantics have been in effect for that column, otherwise sizes are reported in bytes.
*Action: Do among the following
1. Result in the LOB more compact before carrying out the conversion,
for instance, by utilizing SUBSTR on CLOB
2. Use DBMS_LOB.SUBSTR to transform CLOB to CHAR or BLOB to RAW.

However , how big text in posts table by type NCLOB and it is 6059 bytes. It's strange because after i do that without calling function it runs well. i.e. after i run the next script:

declare 
    iclCLOB nvarchar2(6100) := 'Here is the same 6059 bytes string';
    cnuMAX_LENGTH number := 32767 ;
    nuLength Number := DBMS_LOB.getlength(iclCLOB);
    sbBuffer Nvarchar2(32767);
    sbBuffer1 Nvarchar2(32767);
begin
    dbms_lob.read(iclCLOB,nuLength,1,sbBuffer);
    select GetVarChar2(text) into sbBuffer1 from posts where postid = 'anId';
end;

It runs with no problems.

Thanks.

NVARCHAR2 could be 32767 bytes in PL/SQL only 4000 bytes in SQL. Also, try altering the parameter iclCLOB to some NCLOB rather than NVARCHAR2 - the implicit conversion may cause problems.