Oracle error:ORA-01704: string literal too long

Preface: if you are using stored procedure or prompt: string literal too long, use the following method

The core idea is string splicing

part1:


DECLARE
  field1_clob clob := 'first half part';

BEGIN
  update T_protocol set protocol_content = field1_clob  where protocol_id = '111';
END;

commit;

part2:


DECLARE
  field1_clob clob := 'second half part';

BEGIN
  update T_protocol set protocol_content = protocol_content||field1_clob  where protocol_id = '111';
END;

commit;

See section 38142142nd;: https://blog.csdn.net/weixin_40241267/article/details/78923706

Similar Posts: