> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for ARRAY_UPPER function

# ARRAY_UPPER

Returns the maximum index that can be used for an array. Produces `NULL` for `NULL` arrays.

Because Firebolt currently does not support array slices, the maximum index is always the length of the array.
This function is currently only implemented for the second parameter being `1`.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
ARRAY_UPPER(<array>, <int>)
```

## Parameters

| Parameter | Description                                            | Supported input types |
| :-------- | :----------------------------------------------------- | :-------------------- |
| `<array>` | The array whose upper bound should be calculated       | `ARRAY`               |
| `<int>`   | The dimension to look at, for multi-dimensional arrays | `INTEGER`             |

## Return Type

`INTEGER`

## Examples

<div className="query-window">
  ```
  SELECT ARRAY_UPPER([1, 2, 3], 1);
  ```

  | array\_upper <span>int</span> |
  | :---------------------------- |
  | 3                             |

  <p><span>Rows: 1</span><span>Execution time: 5.12ms</span></p>
</div>

<div className="query-window">
  ```
  SELECT ARRAY_UPPER([[1, 2], [3, 4], [5, 6]], 1);
  ```

  | array\_upper <span>int</span> |
  | :---------------------------- |
  | 3                             |

  <p><span>Rows: 1</span><span>Execution time: 4.58ms</span></p>
</div>
