---
title: "TO_ARRAY"
description: "TO_ARRAY SQL\u95A2\u6570\u306F\u3001\u533A\u5207\u308A\u6587\u5B57\u3067\u30C6\u30AD\u30B9\u30C8\u3092\u5206\u5272\u3057\u3001\u30C6\u30AD\u30B9\u30C8\u306E\u914D\u5217\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/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:28Z
license: https://documentation.invantive.eu/ja/
---

## 構文
```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))
```

## 目的
`TO_ARRAY` SQL関数は、区切り文字でテキストを分割し、テキストの配列を作成します。 結果の配列は現在、`INTERNETTABLE`テーブル関数でのみ使用できます。この関数は、3つの位置でテキストの配列を受け付けます。開始URL、`sitemap`句のサイトマップURL、`exclude`句で除外するURLです。

関連項目：[[SPLIT_PART]]および[[Internet Table (internetTableSpec)]]。

パラメータ:
- テキスト（`varchar2`）：分割するテキスト。
- 区切り文字（省略可、`varchar2`）：テキストを分割する区切り文字。 既定値は `,` です。

戻り値：テキストの各部分を`varchar2`の配列として返します。 テキストが`null`または空の場合、`null`を返します。

## 例
次の例では、`###`で区切られた3つのURLを含むテキストを3つのテキストの配列に変換し、これらの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
```
次の例では、2つのURL（デフォルトの区切り文字`,`で区切られた）を含むテキストを配列に変換し、取得したページからこれらのURLを除外します：
```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
```

