Oracle ORA-01704: string literal too long Problem Analysis

Source: Internet
Author: User


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.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.