The following anonymous PL/SQL block copies a
LONG column from table LONGTABLE into a VARCHAR2 column from table VARCHARTABLE, with the assumption
that LONGTABLE.LONGCOLUMN does not exceed 4000 bytes
in length:
declare
string varchar2(4000);
character char(1);
begin
select longcolumn, pk into string, character from longtable;
insert into varchartable values (string, character);
end;
Notice that, even though a varchar2
datatype declaration in PL/SQL can take a
maximum length value of up to 32767, the actual VARCHAR2 datatype in the database can only
accomodate up to 4000 bytes(in 8).
If this is not helping you...please let me know