ORA-01704: string literal too long

update mkt_page_links
set longdescription = ' {some html text > 4000 char} '
where menuidno = 310;

(longdescription  type is clob)

execute this cmd against oracle database via OracleClient, you will get the following error.

ORA-01704: string literal too long

Cause: The string literal is longer than 4000 characters.

Action: Use a string literal of at most 4000 characters. Longer values may only be entered using bind variables.

solution:

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

原文地址:https://www.cnblogs.com/philzhou/p/3275164.html