The CLOB data will be truncated to 32767 characters in PL/SQL as
that's the ultimate length of a VARCHAR2 in that environment. You
won't get your 40,000 characters returned.
There may be other restrictons with ref cursors and LOB data that I am
not aware of.
David Fitzjarrell