> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/array/array-upper",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> 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":"github-light","dark":"github-dark"}}
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`

## Example

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
  ARRAY_UPPER([1, 2, 3], 1);
```

**Returns**: `3`

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
  ARRAY_UPPER([[1], 2, [3, 4]], 1);
```

**Returns**: `3`
