1. 问题起因
最近在进行oracle的一些操作时,总会遇到这个错误: ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小,错误如下:
ORA-00604: 递归 SQL 级别 1 出现错误
ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小
ORA-06512: 在 line 7
2.官方解释
查看官方文档上的解释:
ORA-06502: PL/SQL: numeric or value errorstring
Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
Action: Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
官方解释是: 想存入数据库的数据(包含数据,字符串等等)不符合该字段的定义(比如长度,约束等), 举个例子,就是说你想存一个空值到非空字段,如存入3位以上的数字到NUMBER(2)字段中,等等
官方解决方法是: 改变数据的类型,或长度,等等。