---
title: "LUNGHEZZA"
description: "La funzione SQL LENGTH restituisce, per un varchar2, il numero di caratteri del testo fornito e, per un blob, il numero di byte del BLOB fornito."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/docs/invantive-universalsql/grammar/sql-functions/length
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/length
updated: 2026-12-04T13:53:10Z
license: https://documentation.invantive.eu/it/
---

## Sintassi
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> LENGTH[LENGTH]:::quoted
    LENGTH --> End((END))
```

## Scopo
La funzione SQL `LENGTH` restituisce, per un `varchar2`, il numero di caratteri nel testo fornito e, per un `blob`, il numero di byte nel BLOB fornito.

Parametri:
- Dato di input (`blob` o `varchar2`): il valore da elaborare.

Restituisce: la lunghezza dell'input sotto forma di `int32`.

## Esempi
L'esempio seguente recupera il numero di caratteri presenti in un testo:
```sql
select length('abcdefg')

----------------
7
```
L'esempio seguente recupera il numero di byte contenuti in un elemento `blob`:
```sql
select length(random_blob(512))

----------------
512
```

