Using arrays

An array is a group of related pieces of data associated with one variable. You can use arrays as output variables for the into clause of select and fetch statements. For example:

exec sql begin declare section;
 CS_CHAR  au_array [100] [30];
exec sql end declare section;
exec sql
 select au_lname
 into :au_array
 from authors;

NoteYou can fetch a single item anywhere into an array. However, you can fetch multiple rows only into the beginning of an array.

For details on using arrays with select and fetch into, see “Selecting Multiple Rows using Arrays” on page 6-3.