特殊字符ORA-01480错误的处理
来源:优易学  2011-11-23 18:03:13   【优易学:中国教育考试门户网】   资料下载   IT书店

  今天研发同事询问,超长字符串无法INSERT到数据库。但是长度距离VARCHAR2的上限还有很多。只有1700多个字符。

  检查这个字符按串和对应的错误。发现很怪异,是ORA-01480错误。

  看看这个错误:

  01480, 00000, "trailing null missing from STR bind value"
  // *Cause:    A bind variable of type 5 (null-terminated string) does
  //                 not contain the terminating null in its buffer.
  // *Action: Terminate the string with a null character

  原来字符串中包含&这个特殊字符,所以我们需要“处理”这个特殊的字符。

  可将CHR(38)可以将这个&特殊字符串转换。

  通过这种转换,含有多个这样特殊字符的字符串可以成功插入数据库。

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训