Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

why? : ORA-06532: Subscript outside of limit

user12200443Nov 19 2012 — edited Nov 19 2012
I want to read a number of rows into an array of records.

I keep getting this error (any ideas?):
ERROR at line 1:
ORA-06532: Subscript outside of limit

---
here is the procedure:

CURSOR get_all_locations (type IN VARCHAR2) IS
SELECT
*
FROM group
WHERE type = type;


PROCEDURE fetchAllServerLocations IS
i BINARY_INTEGER := 0;
erec egroup%ROWTYPE;
BEGIN
dbms_output.enable;
dbms_output.put_line('BEGIN: fetchAllServerLocations()');
FOR erec IN get_all_locations('s')
LOOP
-- dbms_output.put_line('i=[' || i || ']');
dbms_output.put_line('server location: [' || erec.group_id || erec.name || ']');
allServerLocations(i) := erec;
i := i + 1;
END LOOP;
dbms_output.put_line('END: fetchAllServerLocations()');
END fetchAllServerLocations;

---
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2012
Added on Nov 19 2012
16 comments
17,573 views