Home » SQL & PL/SQL » SQL & PL/SQL » Error in reading CLOB
Error in reading CLOB [message #39113] Mon, 17 June 2002 12:42 Go to next message
Vinod
Messages: 76
Registered: April 1999
Member
Hi All,

I have written the following function to read CLOB value.

CREATE OR REPLACE funcTION GET_CABLE_message(seqnumber number) return varchar2 IS
charbuf VARCHAR2(4000);
clob_locator CLOB;
read_amount integer;
read_offset integer;
BEGIN
SELECT message INTO clob_locator FROM abacus_cable_info WHERE seq_no =seqnumber;
read_offset := 1;
read_amount := 4000;
dbms_lob.read(clob_locator, read_amount, read_offset, charbuf);
return charbuf;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;

The above function is working fine, But the problem is i can read only upto 4000 Charecters and if i want to read more than that and if i change the charbuf and read_amount to 30000 and when i execute the function i get the following error

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

Can anybody pls help me
Thanks
Vinod
Re: Error in reading CLOB [message #39115 is a reply to message #39113] Mon, 17 June 2002 13:58 Go to previous message
SAI PADMANABHAN
Messages: 3
Registered: June 2002
Junior Member
Try using return as long.
CREATE OR REPLACE funcTION GET_CABLE_message(seqnumber number) return long IS
Previous Topic: Tables and Coloumns in a Stored Procedure
Next Topic: Design of database.
Goto Forum:
  


Current Time: Fri Mar 29 03:42:59 CDT 2024