When using SQL to insert update a table directly in Oracle today, the error of ORA-01704: string literal too long occurs. Our SQL is
UpdateMall_configSetA. category_info ='| Standard
Among them, 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 limits 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
- Declare
- V_clob clob: ='Long text';
- Begin
- Insert Into Table Values(A, 3,: clob );
- End;
2. concatenate strings and use strings for update.
- UpdateMall_configSetCategory_info ='Security protection: 3003 ,' WhereId = 1;
- UpdateMall_configSetCategory_info = category_info |'| Standard parts: 1040140,1035382 ,' WhereId = 1;
This can solve the problem.