I would consider these two solutions as anti-patterns and recommend testing them for performance.
The first method uses the functions that are included in the flex table package.
SELECT values::INT as var1 FROM ( SELECT MapItems(v1) OVER () AS (keys, values) FROM ( SELECT MapDelimitedExtractor( '1234, 2345, 3456, 4567' USING PARAMETERS DELIMITER=',') AS v1 ) AS T ) AS T2 WHERE REGEXP_SUBSTR(values,'\d+',1) IS NOT NULL; var1
The second method uses the functions included in the text index package.
SELECT words::INT AS var1 FROM ( SELECT TxtIndex.StringTokenizerDelim('1234, 2345, 3456, 4567',',') OVER() AS (words, input_string) ) AS T WHERE REGEXP_SUBSTR(words, '\d+',1) IS NOT NULL; var1
source share