---
title: "TRIM"
description: "La funzione SQL TRIM elimina gli spazi bianchi da entrambi i lati del testo fornito."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/docs/invantive-universalsql/grammar/sql-functions/trim
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/trim
updated: 2026-12-04T14:40:29Z
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)) --> TRIM[TRIM]:::quoted
    TRIM --> End((END))
```

## Scopo
La funzione SQL `TRIM` rimuove gli spazi bianchi da entrambi i lati del testo fornito.

Vedi anche [[LTRIM]] e [[RTRIM]].

Parametri:
- Input (`varchar2`): il testo da cui rimuovere i caratteri.
- Caratteri (facoltativo, `varchar2`): i caratteri da rimuovere; il valore predefinito sono gli spazi bianchi.

Restituisce: un testo privato degli spazi bianchi da entrambi i lati.

## Esempi
Il seguente esempio rimuove gli spazi bianchi da entrambi i lati di ` abcd `:
```sql
select trim(' abcd ')

-------------------
abcd
```
Il seguente esempio restituisce `null` poiché l'input contiene solo spazi bianchi:
```sql
select trim(' ')

-------------------

```
Il seguente esempio rimuove i caratteri `:`, `,`, `.`, `[`, `]` e gli spazi bianchi da entrambi i lati dell'input:
```sql
select trim(':,[] hi []:', ': ,.[] ')

-------------------
hi
```

