Skip to Main Content
  • Questions
  • ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind] when selecting rowid

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Hariprasad.

Asked: May 22, 2024 - 4:01 am UTC

Last updated: May 23, 2024 - 2:48 am UTC

Version: 19C

Viewed 1000+ times

You Asked


declare
cursor cur_collection_detail is
select rowid,'ABC' col4, 'ABC' col1, 'ABC2' action_id from TAB1 where COL1= 1286165;
begin
for dtl in cur_collection_detail loop
dbms_output.put_line('Test inprogress..');
end loop;
end;
/

Error report -
ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
ORA-06512: at line 5
ORA-06512: at line 5
06502. 00000 - "PL/SQL: numeric or value error%s"
*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.


ROWID - length(rowid)
*BAAfXwIFxAIdPkIWQ1VSUkVOQ1lfRVhDSEFOR0VfUkFURRdNWE47MjAxOC0wOC0xNjs7Q0FTSEVYMf4 80
*BAAfXwIFxAIdPkIWQ1VSUkVOQ1lfRVhDSEFOR0VfUkFURRdNWE47MjAxOC0wOC0xNjs7Q0hFQ0VYMf4 80

and Connor said...

I can't reproduce here... and I don't really have a test case from you that I can use

SQL> declare
  2  cursor cur_collection_detail is
  3    select rowid,ename, empno from scott.emp;
  4  begin
  5  for dtl in cur_collection_detail loop
  6    dbms_output.put_line('Test inprogress..');
  7  end loop;
  8  end;
  9  /

PL/SQL procedure successfully completed.

SQL> declare
  2  cursor cur_collection_detail is
  3    select rowid,ename, empno from scott.emp;
  4
  5  type tlist is table of   cur_collection_detail%rowtype;
  6  r tlist;
  7  begin
  8  open cur_collection_detail ;
  9  fetch cur_collection_detail bulk collect into r;
 10  close cur_collection_detail;
 11  end;
 12  /

PL/SQL procedure successfully completed.

Rating

  (1 rating)

Comments

Hmmm

Gh, May 24, 2024 - 7:49 pm UTC

Without testing just look at col1 as selected column and the predicat col1 in the where clause and this is enough to understand the error. So Connor you didn't reproduce the same scenario.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library