Cursors and arrays

Use the fetch into array method when you do not know the number of rows to be returned into the array. Declare and open a cursor, then use fetch to retrieve groups of rows. If a fetch into attempts to return more rows than the array can hold, the statement returns the maximum number of rows that the smallest array can hold and SQLCODE displays a negative value, indicating that an error or exception occurred.