Progress
Embedded SQL-92
Guide and Reference
Array Fetches
As described in previous sections, the FETCH statement returns one row at a time from the active set selected by the OPEN statement. ESQL provides the Array Fetch facility for fetching multiple rows at a time from the active set into an explicitly declared array. This is more efficient for fetching a large number of rows since it greatly reduces the number of calls made to the database. See the "Using an SQLDA for Array Fetches" section in "Dynamic SQL Management in ESQL-92," for a description of array fetches using a dynamically declared array.
NOTES
All ESQLC arrays (excluding character arrays) are mapped into a host language structure consisting of the target array and the current size of the array. This is the C Language structure form:
Host language statements can manipulate the array assuming that it is a structure with the same name as the array name and having two components actual_array and array_size. The actual_array component is the array and the array_size component contains the current size of the array.
EXAMPLEThe following example shows how to use two arrays to select up to fifty rows in one fetch:
Executing the FETCH statement sets
tpe_size
to the actual number of rows returned.NOTE: The array fetch facility provided by ESQL is an extension to the SQL-92 standard.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |