Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Language Elements : Data types : Array data types : Assignment
 
Assignment
When an array is assigned to an array target, the assignment is done one element at a time. Two arrays are assignable if their element's data types are mutually assignable. This means:
*When an array is taken from SQL data to be assigned to an array target, the number of elements in the source array equals the maximum number of elements in the target array. The value of each element of the source is assigned to the corresponding element of the target.
*If the maximum number of elements in the target array is less than the number of elements in the source array, then an error is returned.
*If the maximum number of elements in the target array is greater than the number of elements in the source array, the assignment of each of the source element values to the target elements occurs and the rest of the target elements will be assigned values of NULL.
Example
CREATE TABLE TBL (C1 int, C2 int ARRAY[3]);
INSERT into TBL values (1, '111;222;333');
UPDATE TBL SET C2 = '777;888;999';