i try to convert this source code:
SELECT Split.a.value('.', 'VARCHAR(100)') AS Segment
FROM (SELECT CAST ('<M>' + REPLACE(Segments, ',', '</M><M>') + '</M>' AS XML) AS String
FROM #Segments )AS A CROSS APPLY String.nodes ('/M') AS Split(a)
and i got this teradata code:
it's works two weeks before and now not - how it could be???
CREATE MULTISET VOLATILE TABLE tt_Segments
(id integer, Segments varchar(256) character set unicode ) ON COMMIT PRESERVE ROWS;
select * from tt_Segments;
CREATE MULTISET VOLATILE TABLE tt_Segments_Split AS (SELECT d.*
(tt_Segments.id, tt_Segments.Segments, ',/')
(outkey integer, tokennum integer, Segments varchar(20)character set unicode)
) as d )WITH DATA PRIMARY INDEX (Segments)ON COMMIT PRESERVE ROWS;
I tried running it using SQL Assistant 16.00.0.2 and it refused to submit it with a Query is invalid error.
But a different Select based on STRTOK_SPLIT_TO_TABLE succeeded, this is a strange bug.
Upgrading to SQL Assistant 16.00.0.3 fixed the problem :)