﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals / Oracle Forum / ORA - Oracle Database Error Codes - Search via specific error codes. / ORA-00000 Through ORA-09989   / ORA-06502 during a procedure which uses Bulk collect feature and nested tab / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals</description><link>http://www.franklinfaces.com/</link><webMaster>no-reply@FranklinFaces.com</webMaster><lastBuildDate>Thu, 09 Feb 2012 11:08:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: ORA-06502 during a procedure which uses Bulk collect feature and nested tab</title><link>http://www.franklinfaces.com/Topic61-54-1.aspx</link><description>Hello Friends,&lt;br&gt;&lt;br&gt;I found the solution   :)&lt;br&gt;&lt;br&gt;I did one mistake in procedure where the loop should end.&lt;br&gt;&lt;br&gt;I used the statement: EXIT WHEN cur_terminal_info%rowcount &lt;= 0;&lt;br&gt;&lt;br&gt;But it should be: EXIT WHEN Tab_Terminal_Info.COUNT &lt;= 0;&lt;br&gt;&lt;br&gt;Now my script is working fine now.    :)&lt;br&gt;&lt;br&gt;Thanks and Regards,</description><pubDate>Sun, 18 Jan 2009 10:19:21 GMT</pubDate><dc:creator>Admin</dc:creator></item><item><title>ORA-06502 during a procedure which uses Bulk collect feature and nested tab</title><link>http://www.franklinfaces.com/Topic61-54-1.aspx</link><description>Hello Friends,&lt;BR&gt;&lt;BR&gt;I have created one procedure which uses Bulk collect and nested table to hold the bulk data. This procedure was using one cursor and a nested table with the same type as the cursor to hold data fetched from cursor. Bulk collection technique was used to collect data from cursor to nested table. But it is giving ORA-06502 ora error.&lt;BR&gt;&lt;BR&gt;I reduced code of procedure to following to trace the error point. But still the ora error is coming. Please help us to find the cause and solve it.&lt;BR&gt;&lt;BR&gt;Script which is giving error:&lt;BR&gt;declare&lt;BR&gt;v_Errorflag BINARY_INTEGER;&lt;BR&gt;v_flag number := 1;&lt;BR&gt;CURSOR cur_terminal_info Is&lt;BR&gt;SELECT distinct&lt;BR&gt;'a' SettlementType&lt;BR&gt;FROM&lt;BR&gt;dual;&lt;BR&gt;TYPE typ_cur_terminal IS TABLE OF cur_terminal_info%ROWTYPE;&lt;BR&gt;Tab_Terminal_info typ_cur_Terminal;&lt;BR&gt;BEGIN&lt;BR&gt;v_Errorflag := 2;&lt;BR&gt;OPEN cur_terminal_info;&lt;BR&gt;LOOP&lt;BR&gt;v_Errorflag := 4;&lt;BR&gt;FETCH cur_terminal_info BULK COLLECT INTO tab_terminal_info LIMIT 300;&lt;BR&gt;EXIT WHEN cur_terminal_info%rowcount &amp;lt;= 0;&lt;BR&gt;v_Errorflag := 5;&lt;BR&gt;FOR Y IN Tab_Terminal_Info.FIRST..tab_terminal_info.LAST&lt;BR&gt;LOOP&lt;BR&gt;dbms_output.put_line(v_flag);&lt;BR&gt;v_flag := v_flag + 1;&lt;BR&gt;end loop;&lt;BR&gt;END LOOP;&lt;BR&gt;v_Errorflag := 13;&lt;BR&gt;COMMIT;&lt;BR&gt;END;&lt;BR&gt;&lt;BR&gt;I have updated script as following to change datatype as varchar2 for nested table, but still same error is&lt;BR&gt;comming..&lt;BR&gt;&lt;BR&gt;declare&lt;BR&gt;v_Errorflag BINARY_INTEGER;&lt;BR&gt;v_flag number := 1;&lt;BR&gt;CURSOR cur_terminal_info Is&lt;BR&gt;SELECT distinct&lt;BR&gt;'a' SettlementType&lt;BR&gt;FROM&lt;BR&gt;dual;&lt;BR&gt;TYPE typ_cur_terminal IS TABLE OF varchar2(50);&lt;BR&gt;Tab_Terminal_info typ_cur_Terminal;&lt;BR&gt;BEGIN&lt;BR&gt;v_Errorflag := 2;&lt;BR&gt;OPEN cur_terminal_info;&lt;BR&gt;LOOP&lt;BR&gt;v_Errorflag := 4;&lt;BR&gt;FETCH cur_terminal_info BULK COLLECT INTO tab_terminal_info LIMIT 300;&lt;BR&gt;EXIT WHEN cur_terminal_info%rowcount &amp;lt;= 0;&lt;BR&gt;v_Errorflag := 5;&lt;BR&gt;FOR Y IN Tab_Terminal_Info.FIRST..tab_terminal_info.LAST&lt;BR&gt;LOOP&lt;BR&gt;dbms_output.put_line(v_flag);&lt;BR&gt;v_flag := v_flag + 1;&lt;BR&gt;end loop;&lt;BR&gt;END LOOP;&lt;BR&gt;v_Errorflag := 13;&lt;BR&gt;COMMIT;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;I could not find the exact reason of error.&lt;BR&gt;Please help us to solve this error.&lt;BR&gt;&lt;BR&gt;Thanks and Regards..</description><pubDate>Sun, 18 Jan 2009 10:18:31 GMT</pubDate><dc:creator>Admin</dc:creator></item></channel></rss>
