Kamran Agayev's Oracle Blog

Oracle Certified Master

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

Posted by Kamran Agayev A. on November 19th, 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;

)

2 Responses to “ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind”

  1. Fillemon Haufiku Says:

    Hi Mr Kamran

    Can you Kindly help me on how to create query for sick leave cycle over a three years period

  2. Kamran Agayev A. Says:

    Could you please elaborate more?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>