Skip to Main Content

Oracle Database Discussions

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!

problem dbms_lob.substr

Frank LehmannApr 13 2020 — edited Apr 14 2020

Hello helpers,

i need some explanation here.

I have a clob column which has a length of 6435 !

Select dbms_lob.getlength(clob_colum) from clob_table;

But when i want to shorten this to 4000 i get an error!

select dbms_lob.substr(clob_column,4000) from clob_table;

ORA-06502: PL/SQL: numerischer oder Wertefehler: Zeichenfolgenpuffer zu klein

But when i use the length of 3930 it is working fine.

select dbms_lob.substr(clob_column,3930) from clob_table;

The documentation says:

DBMS_LOB.SUBSTR (

  lob_loc IN CLOB CHARACTER SET ANY_CS,

  amount IN INTEGER := 32767,

  offset IN INTEGER := 1)

  RETURN VARCHAR2 CHARACTER SET lob_loc%CHARSET;

So the value should be at least till 32767 characters, but it is not working.

Why it is ?

Regards

Frank

This post has been answered by Mike Navickas on Apr 13 2020
Jump to Answer
Comments
Post Details
Added on Apr 13 2020
6 comments
5,218 views