Kamran Agayev's Oracle Blog

Oracle Certified Master

Archive for November 19th, 2012

ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind

Posted by Kamran Agayev A. on 19th November 2012

Today, when I was using BULK COLLECT to fetch some rows to the collection, I got the following error:

ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind

I checked my code and didn’t find anything special that can cause this error. After investigating a while, I found that the row which has length more than 2000 bytes causes that error. I checked my collection and saw that this row was defined as – dbms_sql.varchar2_table

What do you think, how it was defined in the package level (DBMS_SQL)? I was thinking it was defined as “VARCHAR2(4000)“, but it was “VARCHAR2(2000)“.

type Varchar2_Table is table of varchar2(2000) index by binary_integer;

So I declared new variable, changed the declaration of my collection as follows and it worked:

type Varchar4000_Table is table of varchar2(4000) index by binary_integer;

TYPE trec  IS RECORD (

…..

…..

column Varchar4000_Table;

)

Posted in Administration, SQL and PL/SQL | 2 Comments »