Parameters: (String, Integer);
Returns: String;
Function to extract the value at a given index in an array of strings (csv).
The first parameter is the array string. This should use csv format. Double quote delimiters are supported but not required.
The second parameter is the index, zero based.
The element in the array at the index given will be returned.
The element in the array at the index given is an empty string, NULL will be returned.
If the array is NULL, NULL will be returned.
If the index is NULL, negative or greater than the number of elements in the array, NULL will be returned.
Example 1:
GET_ARRAY_VALUE('London,Paris,New York',1) Result: 'Paris'
Example 2:
GET_ARRAY_VALUE('London,Paris,New York',NULL) Result: NULL
Example 3:
GET_ARRAY_VALUE('',0) Result: NULL
Example 4:
GET_ARRAY_VALUE('London,Paris,New York',3) Result: NULL
Comments
0 comments
Please sign in to leave a comment.