When inserting a large number of strings (mainly HTML content) through INSERT statements, more than 4000 characters are reported:
ORA-01489: String concatenated result is too long
Although the field is CLOB, it is sufficient to store it, but by this direct insertion, because there is no mandatory designation with the insertion string as the CLOB type,
Oracle handles the inserted string as a "string type", which causes an error because Oracle has the maximum string limit (no more than 4,000 characters).
Workaround: Specify the type of string to insert as CLOB, which can be used with procedures or stored procedures
Example:
DECLARE
Reallybigtextstring CLOB: = ' massive string to be inserted ';
BEGIN
INSERT into test_table VALUES (' Test ', reallybigtextstring, ' 0 ');
End;
/
Commit
This will solve the problem.
How do I insert a large number of strings into the Oracle CLOB field with an INSERT statement from SQL?