Oracle ORA-01704: string literal too long problem analysis today when using SQL in oracle to directly insert update a table, the error of ORA-01704: string literal too long occurs, our SQL is [SQL] update mall_config a set. category_info = '| standard www.2cto.com
Parts: Clerk, clerk, 1035385,1455, clerk, 142.161,00006875, clerk, 10353,1035466, clerk, clerk, 1035341,1035449, 1032470,102.1639, 1035381, Expires, 142.164,1035448, 1035458,1035465, expires, 102.1637,1035443, 103520.,2787, 142.162,1035388, 141908,1096878, 102.1627,1032401, expires, 1036588,103 5459 ...... '; where the category_info field is of the clob type, and the subsequent string content is very long. Although clob can be enough to save such a long string, the Syntax Parsing of SQL statements imposes a limit on the field length, the text string is too long! There are two solutions: 1. use the stored procedure to store ultra-long text in a variable, and then insert update [SQL] declare www.2cto.com v_clob clob: = 'long text'; begin insert into table values (, 3,: clob); end;
2. string concatenation. update uses String concatenation [SQL] update mall_config set category_info = 'Security Protection: 3003, 'where id = 1; update mall_config set category_info = category_info |' | standard part: 1040140,1035382, 'where id = 1; this can solve the problem.