ARRAY_GET
Function
Retrieves an element at a specified index in an array.
Syntax
ARRAY_GET(array, element-index)
Parameters
- array: blob
The array from which to read an element. - element-index: integer
Zero-based index into the array.
Return Value
The specified array element, orNULL
if the index is outside the bounds of the
array.Example
DECLARE @a = ARRAY(1, 2, 3);
PRINT ARRAY_GET(@a, 2); -- "3"
DECLARE @b = ARRAY_GET(@a, 10); -- @b is NULL
IF @b IS NULL PRINT 'Null!'; -- Prints.