oracle ORA-01704: string literal too long问题分析
今天使用sql在oracle直接insert update一个表时,出现ORA-01704: string literal too long的错误,我们的sql是
update mall_config a set a.category_info='|标准件:1040140,1035382,1036586,1035383,1032451,1032469,141903,1036587,1044047,1035380,1035385,1455,1035379,1035376,1035464,141906,1046869,1035386,141909,1035377,141901,1046875,1042427,1032449,1035338,1035468,1046879,1035343,10353,1035466,1036788,1035467,1046874,1035446,1035341,1035449,1032470,1035339,1035342,1046868,1040201,1046870,1035447,1042428,1035463,1035340,1035450,1035445,1035444,1040197,1035381,1035629,1046877,141904,1035448,1035458,1035465,1040211,1035387,1035337,1035443,1035378,1042787,141902,1035388,141908,1046878,1042627,1032401,1046871,1035384,1036588,1035459......';
其中category_info字段是clob类型,而后面字符串内容很长,虽然clob可以足够可以保存这么长的字符串,但是sql语句的语法解析对字段却有长度限制,文字字符串过长!
有两种方法可以解决:
1.使用存储过程,把超长文本保存在一个变量中,然后再insert update
- declare
- v_clob clob :='一个长文本';
- begin
- insert into table values(a,3,:clob);
- end;
2.字符串拼接,update使用字符串拼接
- update mall_config set category_info='安全防护:3003,' where id=1;
- update mall_config set category_info=category_info||'|标准件:1040140,1035382,' where id=1;
这都可以解决问题。
oracle ORA-01704: string literal too long问题分析的更多相关文章
- oracle ORA-01704: string literal too long
导出数据时,在SQL拼接处,提示 oracle ORA-01704: string literal too long sql: WITH already_in AS (SELECT distinct ...
- ORA-01704: string literal too long
update mkt_page_links set longdescription = ' {some html text > 4000 char} ' where menuidno = 310 ...
- 使用MySql数据库, 浏览器接收返回数据报错SyntaxError: unterminated string literal
用php写了一个很简单的页面, 用来记录常用的oracle的关键字和各种函数, 以后用起来查一下方便, 原来是用java写了一个web项目, 但是用起来太麻烦, 真的不如php方便, 然后就把整理的内 ...
- JAVA问题String literal is not properly closed by a double-quote
String literal is not properly closed by a double-quote 这个错误:string字串没有以双引号结束String DBURL = "jd ...
- format not a string literal and no format arguments
今天cocos2d-x打包 android的时候报错:format not a string literal and no format arguments 报错点是:__String::create ...
- Android studio2.2 ndk 错误 :format not a string literal and no format arguments!
在Android Studio2.2 进行NDK编程,在对*char 字符串 进行日志输出时,报错: error: format not a string literal and no format ...
- C++11:新式的字符串字面常量(String Literal)
自C++11起,我们可以定义 raw string 字符串字面常量. Raw string 允许我们定义所见即所得的字符串字面常量,从而可以省下很多用来修饰特殊 字符的符号. Raw string 以 ...
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
原文地址 : http://www.cnblogs.com/hhuang2012/p/3336911.html cocos2dx android版本移植时的Error format not a str ...
- Error format not a string literal and no format arguments解决方案
原地址: http://blog.csdn.net/joeblackzqq/article/details/25985299 cData.cpp:355:30:error:format not a s ...
随机推荐
- Spoj 3267 DQUERY - D-query
题目描述 English VietnameseGiven a sequence of n numbers a _{1}1 , a _{2}2 , ..., a _{n}n and a numbe ...
- MySQL命令行自动补全表名
注意:在命令行下只有切换到数据库之后,才能补全表名,对于命令是不能补全的. 1.my.conf增加如下配置: [mysql] #no-auto-rehash auto-rehash #添加auto-r ...
- Spring Boot中验证码实现kaptcha
要生成验证码网上的方案比较多,基本是基于两大类:1为自定义生成,操作用Image类,2为kaptcha生成,有模糊算法. 当然也可以直接交由前端进行处理 1.基于kaptcha 首先不要怀疑的是报名是 ...
- FreeFileSync同步定时执行
Schedule a Batch Job Create a new batch job via FreeFileSync's main dialog: Menu → File → Save as a ...
- hdu 3255 Farming(扫描线)
题目链接:hdu 3255 Farming 题目大意:给定N个矩形,M个植物,然后给定每一个植物的权值pi,pi表示种植物i的土地,单位面积能够收获pi,每一个矩形给定左下角和右上角点的坐标,以及s, ...
- linux远程管理工具:putty
使用QTP测试文件上传和目录做成是否成功,必须先将文件和目录下载到本地,再作比较.现在下载工具众多,其中putty是最出色的一个,支持linux服务器,这点很重要“免费的”.下面就让我们来看一下吧! ...
- 命题作文:在一棵IPv4地址树中彻底理解IP路由表的各种查找过程
这是一篇命题作文.近期一直想写点东西,但一直找不到题目.正好收到一封邮件,有人问我Linux路由表的布局问题以及路由缓存的问题,加之前些日子又帮人做了一个片上路由表,所以认为这是个好题目,索性花了多半 ...
- ArrayAdapter requires the resource ID to be a TextView
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABDUAAADFCAIAAADLz168AAAgAElEQVR4nO2d368kxZXnQ37dn9qdWa
- SpringMVC_中文乱码的配置 --跟海涛学SpringMVC(和自己在项目中的实际使用的对比)
spring Web MVC框架提供了org.springframework.web.filter.CharacterEncodingFilter用于解决POST方式造成的中文乱码 <filte ...
- 一些java错误
@Override must override a superclass method 问题解决 如果在使用Eclipse开发Java项目时,在使用 @Override 出现以下错误: The met ...