## Syntax ```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)) ``` ## Purpose The `TO_ARRAY` SQL function splits a text on a separator into an array of texts, for instance for use with table functions accepting an array such as `INTERNETTABLE`. See also [[SPLIT_PART]]. Parameters: - Text (`varchar2`): the text to split. - Separator (optional, `varchar2`): the separator to split the text on. Defaults to `,`. Returns: the parts of the text as an array of `varchar2`. Returns `null` when the text is `null` or empty. ## Examples The following example converts a text with three URLs separated by `###` into an array of three texts and retrieves the pages found on these URLs: ```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 ```