---
title: "SHORTEN"
description: "La funzione SQL SHORTEN riduce un testo a una lunghezza massima."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/docs/invantive-universalsql/grammar/sql-functions/shorten
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/shorten
updated: 2026-12-04T14:25:12Z
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)) --> | | SHORTEN[SHORTEN]:::quoted
    SHORTEN --> End((END))
```

## Scopo
La funzione SQL `SHORTEN` riduce un testo alla lunghezza massima consentita. Quando il testo supera la lunghezza massima, viene rimosso del testo dalla parte centrale, sostituendo il testo rimosso con un testo più breve.

Parametri:
- Input (`varchar2`): testo da accorciare.
- Lunghezza (`int32`): lunghezza massima del testo abbreviato.
- Sostituzione (opzionale, `varchar2`): testo con cui sostituire il testo rimosso. Il valore predefinito è `...`.

Restituisce: il testo di input abbreviato alla lunghezza specificata.

## Esempi
L'esempio seguente accorcia un testo fino a un massimo di 15 caratteri:
```sql
select shorten('The quick brown fox jumps over the lazy dog', 15)

-------------------
The qu...zy dog
```
L'esempio seguente lascia il testo invariato poiché non supera la lunghezza massima:
```sql
select shorten('The quick brown fox', 50)

-------------------
The quick brown fox
```

