Array element references are made using the syntax column-name[subscript], as shown in the following example. Non-subscripted array references are not allowed. Array element references must be assigned specific column names in the view, using either the AS-clause in the view-defining query, or an explicit view-column-name list. Outside of the CREATE DATACOM VIEW statement, references to these columns are made using the column names of the view.
Following is an example of a DATACOM VIEW containing references to array elements. The sales column does not have to be a redefinition to be visible to CREATE DATACOM VIEW:
CREATE DATACOM VIEW (sales01, sales02, sales03, sales04,
sales05, sales06, sales07, sales08,
sales09, sales10, sales11, sales12) AS
SELECT sales[1], sales[2], sales[3], sales[4], sales[5], sales[6],
sales[7], sales[8], sales[9], sales[10], sales[11], sales[12]
FROM <-tableName>;
As shown in this example, elements of an array may be referenced with a literal integer subscript within square brackets within the range of 1 to the number of occurrences. For example, to reference sales for October: sales[10].
As already mentioned, reference to an element of an array is restricted to DATACOM VIEWs.
|
Copyright © 2014 CA.
All rights reserved.
|
|