PL/SQL (MOSC)

MOSC Banner

substring CLOB value with value more than 32K

Hi All

Kindly, I am trying to substring clob value by removing the first 33 characters and the last 2 characters,

  • I try with the following simple code but it's returned an error: ORA-06502: PL/SQL: numeric or value error

-------------------------------------------------------

DECLARE

 p_Clob_Input CLOB := ''; --> value more than 32K

 p_Clob_Output CLOB; --> input CLOB value after removing first 33 characters and last 2 characters

BEGIN

 Dbms_Lob.Createtemporary(p_Clob_Output, FALSE);

 Dbms_Lob.Writeappend(p_Clob_Output, Dbms_Lob.Getlength(p_Clob_Input)-35,Dbms_Lob.Substr(p_Clob_Input,Dbms_Lob.Getlength(p_Clob_Input)-2, 33));

END;

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center