Is it possible to create a 2D array?
NVT
-
Comment actionsOfficial comment
Hi Pavel,
yes, this is possible. To an array, you can add both an primitive type as well as another array. The documentation can be found here: https://documentation.datavirtuality.com/24/reference-guide/scalar-functions/array-functions
I extended the information there with an example of 2 dimensions:
BEGIN
DECLARE OBJECT favourite_animals = ARRAY(ARRAY('penguin', 'goat', 'goose'), ARRAY ('whale', 'fox', 'cat'));
SELECT CAST(ARRAY_GET(ARRAY_GET(favourite_animals, 1), 1) as STRING);
ENDAdditionally, when going for 2 dimensional information, it makes sense to check out our temporary tables. These are tables that live in memory while a block / procedure is running. The documentation can be found here: https://documentation.datavirtuality.com/24/reference-guide/ddl-support/temp-tables
Please let me know if there are any questions.
Best,
Matthias
Please sign in to leave a comment.
Comments
1 comment