Im using a simple while loop to retrive comments from one table, split the comments to 75 chars each row and insert it in a new table. But some comments are encountering exception because the comments have single quotes ('). Any idea how to rectify without any data loss?
Counter := 1;
while comments is not null LOOP
op :=substr(comments,1,75);
begin
insert into Comments_Splitted_TXT (id_comment,comm_no,COUNT_Comment,Comments)
values (COMMENTS_SPLITTED_SEQUENCE.currval,Comments_Splitted_TXT_SEQUENCE.NEXTVAL,Counter,op);
exception
when others then dbms_output.put_line(COMMENTS_SPLITTED_SEQUENCE.currval);
end;
comments:= substr(comments,76);
Counter :=Counter+1;
end loop;
Error message:
- 00000 - "value too large for column %s (actual: %s, maximum: %s)" *Cause: An attempt was made to insert or update a column with a value which is too wide for the width of the destination column. The name of the column is given, along with the actual width of the value, and the maximum allowed width of the column. Note that widths are reported in characters if character length semantics are in effect for the column, otherwise widths are reported in bytes