Progress
Embedded SQL-92
Guide and Reference
Type Specifications for Static Array Types
Declares a static array or array type consisting of elements of any data type. This array declaration must be within a BEGIN-END DECLARE SECTION.
SYNTAX
variable_name
C Language variable name.
TYPE new_type_name
Identifies the data type of the array being declared.
IS AN ARRAY OF type_name
Identifies the data type of the array being declared.
WITH SIZE constant_id
A constant defining the dimension or size of the array.
NOTES
EXAMPLE
- ESQLC does not allow the definition of open size arrays.
- All ESQLC arrays except for character arrays are mapped into a host language structure consisting of both the actual array and the current size of the array. The C Language structure is of this form:
- Host language statements can manipulate the array assuming that is is a structure with the same name as the array name, and having two components
tpe_array
andtpe_size
. Thetpe_size
component contains the actual array and thetpe_size
component contains the current size of the array.- All ESQLC statements that manipulate the array update the current size associated with the array. The host language statements that manipulate the array are expected to update the current size.
- Character arrays are a special case for the ESQLC precompiler. They are not mapped to a record, but rather as a null terminated string. This simplifies their manipulation from C and their use with system functions. When the ESQLC precompiler manipulates a character array, the null terminator is assured.
- When you refer to an array element in an SQL-92 statement, you should specify the array name followed by the element index in square brackets.
This example illustrates how to refer to an array element in an SQL-92 statement:
EXAMPLEThis example illustrates an array variable in the INTO clause of a FETCH statement:
EXAMPLEThis example illustrates how to define an array variable to be used by a FETCH statement
ENVIRONMENT
Embedded SQL-92 only
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |