Arrays
RDM allows integer or real type data columns of a table to be defined as one-dimendional arrays.
The following CREATE TABLE examples illustrate the use of ARRAY types:
Example 1
CREATE TABLE sale_emp ( name char(50), pay_by_quarter integer array[4] );
Snippet from the generated C structure from rdm-compile
tool using --c-structs
option.
/** \brief struct definition for table SALE_EMP */ typedef struct SALE_EMP_S { char NAME[201]; int32_t PAY_BY_QUARTER[4]; RDM_HAS_VALUE_T _NAME_has_value; RDM_HAS_VALUE_T _PAY_BY_QUARTER_has_value; } SALE_EMP;
The above command will create a table named SALE_EMP
with a column of type CHAR (NAME
) and a one-dimensional array of type INTEGER (PAY_BY_QUARTER
), which represents the employee's salary by quarter for 4 quarters.
An array is a considered a single field (or column) so, either all dimensions are NULL or they all have a value.
Arrays are used for defining the dimensions of an R-tree index. For more information, refer to the R-tree Index Overview section.
See Also