Alternative to Strtok in Teradata Aster

Aster

Alternative to Strtok in Teradata Aster

Hi Team - i have a string field with about 600,000 rows like the below. Aster data base is connected through Teradata Studio.

Text1,Text2,Text3

Text1,Text2

Text1,Text2,Text3,Text4,Text5

I need each date in a different column, i tried strtok but Teradata studio gives me an error that it does not support strtok. Can anyone please help. thank you.

Tags (1)
2 REPLIES
Junior Contributor

Re: Alternative to Strtok in Teradata Aster

As long as there's only a single character delimiter you can get a similar result using split_part('Text1,Text2,Text3,Text4,Text5',',',1) 

Caution: multiple consecutive delimiters will be treated as one in Teradata, but not in Aster, e.g. split_part('Text1,,Text2,Text3,Text4,Text5',',',2) returns 'Text2' in Teradata but '' in Aster.

Enthusiast

Re: Alternative to Strtok in Teradata Aster

Hy Dieter

i want to ask you something about error in aster 

i've a problem with the query extract load from teradata to aster , but any something wrong with this query , 

-- query for example : 

INSERT INTO SB7.ASP_OVERCHARGE_SUBS

SELECT * FROM load_from_teradata (ON mr_driver

     tdpid('edw2')USERNAME('anggis')PASSWORD('Marvel93')

     QUERY ('SELECT DISTINCT SUBSCRIBER_NO, MSISDN_SUBS from XL_DATA_POSTPAID.ASP_OVERCHARGE_ANALYSIS')

)

 

but the error is 'mailman setup' so, please help to fix about this problem ya guys ?

 

thanks a lot