Vance
Vance

Reputation: 897

I can't make CLOB work

Im a beginner in using oracle CLOBs. Im trying to set an apex value using a function that will return a clob. I am running this function using sql plus and I got no error but when I used this to set the item(text area) value, it give me the numeric or value error. To be more clear here's the code:

CREATE FUNCTION MY_FUNCTION RETURN clob IS
 v_clob CLOB; 
BEGIN
   for a in 1..1000000 LOOP
      v_clob:= v_clob|| to_char(a) || '|';
   END LOOP;
RETURN v_clob;
END;

Is there a way on how to make this work? Is it because a text area is not enough to hold that CLOB's value or is it something else? I believe a text area item can hold lots(millions) of characters so i dont know what's wrong..

Upvotes: 0

Views: 90

Answers (1)

Tharunkumar Reddy
Tharunkumar Reddy

Reputation: 2813

Small modifications to your function..

CREATE or replace  FUNCTION MY_FUNCTION RETURN CLOB IS
v_clob CLOB; 
BEGIN
for a in 1..100000 LOOP
v_clob:= v_clob|| to_char(a) || '|';
END LOOP;
RETURN v_clob;
END;

For running the function

select my_function() from dual

Upvotes: 1

Related Questions