Oracle ORA-01704: string literal too long Problem Analysis

Source: Internet
Author: User

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

  1. Declare
  2. V_clob clob: ='Long text';
  3. Begin
  4. Insert Into Table Values(A, 3,: clob );
  5.  End;

2. concatenate strings and use strings for update.

  1. UpdateMall_configSetCategory_info ='Security protection: 3003 ,' WhereId = 1;
  2. UpdateMall_configSetCategory_info = category_info |'| Standard parts: 1040140,1035382 ,' WhereId = 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.