Error : ORA-01704: string literal too long

后端 未结 4 976
梦毁少年i
梦毁少年i 2020-11-29 06:58

While I try to set the value of over 4000 characters on a field that has data type CLOB, it gives me this error :

ORA-01704: string lite

4条回答
  •  盖世英雄少女心
    2020-11-29 07:50

    To solve this issue on my side, I had to use a combo of what was already proposed there

    DECLARE
      chunk1 CLOB; chunk2 CLOB; chunk3 CLOB;
    BEGIN
      chunk1 := 'very long literal part 1';
      chunk2 := 'very long literal part 2';
      chunk3 := 'very long literal part 3';
    
      INSERT INTO table (MY_CLOB)
      SELECT ( chunk1 || chunk2 || chunk3 ) FROM dual;
    END;
    

    Hope this helps.

提交回复
热议问题