Error : ORA-01704: string literal too long Error : ORA-01704: string literal too long codeigniter codeigniter

Error : ORA-01704: string literal too long


What are you using when operate with CLOB?

In all events you can do it with PL/SQL

DECLARE  str varchar2(32767);BEGIN  str := 'Very-very-...-very-very-very-very-very-very long string value';  update t1 set col1 = str;END;/

Proof link on SQLFiddle


Try to split the characters into multiple chunks like the query below and try:

Insert into table (clob_column) values ( to_clob( 'chunk 1' ) || to_clob( 'chunk 2' ) );

It worked for me.


The split work until 4000 chars depending on the characters that you are inserting. If you are inserting special characters it can fail.The only secure way is to declare a variable.