oracle ORA-01704: string literal too long问题分析
来源:互联网 发布:淘宝服装货源怎么找 编辑:程序博客网 时间:2024/05/22 04:48
今天使用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
declarev_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
- ORA-01704: string literal too long 和 ORA-00932: inconsistent datatypes: expected NUMBER got LONG
- Oracle异常ORA-01861: literal does not match format string。
- Oracle 异常 ORA-01861: literal does not match format string
- 初步分析make的一个问题:Argument list too long
- Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
- Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
- oracle学习笔记【 ORA-01861: literal does not match format string(字符串格式不匹配)】
- 解决:Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
- 解决Oracle异常ORA-01861:literal does not match format string(字符串格式不匹配)
- Oracle异常ORA-01861:literal does not match format string(字符串格式不匹配)
- Hibernate(oracle)下的ORA:A-00972 identifier is too long提示
- 超過 Oracle 的長度限制 ORA-00972: identifier is too long
- oracle错误(三) ORA-00972 identifier is too long 的解决办法
- Argument list too long分析
- ORA-00972: identifier is too long
- An (int, float,long,double,String) literal value
- 将win7电脑无线网变身WiFi热点,让手机、笔记本共享上网
- 程序员的五件武器
- C++实现链表操作
- startActivityForResult的用法
- mysql数据库的优化
- oracle ORA-01704: string literal too long问题分析
- Phil Libin的六步计划 让Evernote从应用变成平台
- c++、vc++ 数据精度、小数点取舍、数据四舍五入、保留2位小数、数据之间加入","
- strlen与sizeof区别
- Bloom Filter
- SqlDataReader的GetChar不支持所指定的方法
- java读取zip文件和压缩zip文件
- C++ string转换CString .
- Apache与Tomcat的区别以及几种常见的web应用服务器