I have a variable that is defined as CLOB.
Then i have several queries concatenated based on some conditions, like something below:
var1 := 'insert into temp select a,b,c from x,y,z';
var1:= rtrim ( var1|| ' '|| ' x.a = : a1 ');
var1:= rtrim ( var1|| ' '|| ' y.b1 = :b1 ');
and so on..
At the end I have execute immediate var1 using a1, b1..
When I use PLSQL block to test it works fine. Then I tried to put the same in a stored procedure and try to execute the procedure.
But the procedure execution gives ''ORA-01461: can bind a LONG value only for insert into a LONG column'' error..
I checked the length of the CLOB variable after all cancatenations and its coming to around 4000 - 5000 characters..
Can you guys help me? do not know if I am doing something wrong or missing something..