You are not limited to 4000 bytes for varchar2 in pl/sql. Use a defn like:

v_strstmt varchar2(32767);

32767 is the max dim you can have in pl/sql.


I am not sure whether the big statement will be executed by "execute immediate". Please post your results here

-amar