STRTOK_SPLIT_TO_TABLE Function Example | VantageCloud Lake - Example: STRTOK_SPLIT_TO_TABLE Function - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

If:

CREATE TABLE t (id integer, str varchar(256)character set unicode);

and:

INSERT INTO t VALUES (1,'Teradata-Warehouse 13.10 - Combine 2 powerful forms of business intelligence (BI).'); 

and:

insert into t values (2,'http://www.teradata.com/');

then:

SELECT d.* FROM TABLE (strtok_split_to_table(t.id, t.str, ' -/')
RETURNS (outkey integer, tokennum integer, token varchar(20)character set unicode) ) as d order by 1,2;

Result:

outkey   tokennum  token
-----------  -----------  --------------------------
          1            1  Teradata
          1            2  Warehouse
          1            3  13.10
          1            4  Combine
          1            5  2
          1            6  powerful
          1            7  forms
          1            8  of
          1            9  business
          1           10  intelligence
          1           11  (BI).
          2            1  http:
          2            2  www.teradata.com