why? : ORA-06532: Subscript outside of limit
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;
---