---
title: "TO_ARRAY"
description: "La funzione SQL TO_ARRAY suddivide un testo in base a un separatore in un array di testi."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/docs/invantive-universalsql/grammar/sql-functions/to-array
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/to-array
updated: 2026-12-04T14:35:21Z
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)) --> TO_ARRAY[TO_ARRAY]:::quoted
    TO_ARRAY --> End((END))
```

## Scopo
La funzione SQL `TO_ARRAY` suddivide un testo in base a un separatore in un array di stringhe. L'array risultante può attualmente essere utilizzato esclusivamente con la funzione tabella `INTERNETTABLE`, che accetta un array di testi in tre posizioni: gli URL iniziali, gli URL della mappa del sito della clausola `sitemap` e gli URL da escludere della clausola `exclude`.

Vedi anche [[SPLIT_PART]] e [[Internet Table (internetTableSpec)]].

Parametri:
- Testo (`varchar2`): il testo da suddividere.
- Separatore (opzionale, `varchar2`): il separatore in base al quale suddividere il testo. Il valore predefinito è `,`.

Restituisce: le parti del testo come array di `varchar2`. Restituisce `null` quando il testo è `null` o vuoto.

## Esempi
L’esempio seguente converte un testo contenente tre URL separati da `###` in un array di tre testi e recupera le pagine presenti a questi URL:
```sql
select t.*
from   internettable
       ( to_array
         ( 'https://cloud.invantive.com'
           || '###https://cloud.invantive.com/language/nl'
           || '###https://cloud.invantive.com/language/en'
         , '###'
         )
         sitemap 'https://cloud.invantive.com/sitemap.xml'
         max depth 2
       ) t
limit  10
```
L’esempio seguente converte un testo contenente due URL separati da `,` (il separatore predefinito) in un array ed esclude tali URL dalle pagine recuperate:
```sql
select t.*
from   internettable
       ( 'https://invantive.com'
         sitemap 'https://www.invantive.com/sitemap.xml'
         exclude to_array('https://invantive.com/privacy/index.html,https://invantive.com/products/index.html')
         stay on site
         max depth 1
       ) t
limit  10
```

