Problem with error 06502 and cursor
908996Jan 4 2012 — edited May 16 2013Hello.
I have a problem with my code. I'll put an example:
PROCEDURE Example() IS
cursor example_cursor is select example_field1, example_field2,... from example_table;
example_var example_cursor%rowtype;
BEGIN
for example_var in example_cursor loop
dbms_output.put_line(example_var.example_field1);
end loop;
END;
When I call the procedure from an anonimous block, the procedure execution fails giving me the ora-06502 Bulk Bind Truncated Bind error in the "for example_var in example_cursor loop" line.
But, when I execute only the code in an anonimous block with declare cursor... begin for... end; it works.
I don't know what can I do, or what must I searf for, to fix this problem.
Thanks.