Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Find position of a character in a string - response (8) by dnoeth

$
0
0

Hi Carlos,
no excuses, you're welcome :-)
 
Of course you can use a cross join to a number table to split a string, but performance mainly depends on the defined size of the VARCHAR - cross joining a large number of rows to a few hundred/thousand rows consumes a ot of CPU. I tested several variations of cross joins/recursion some years ago and none was even close to a DelimitedToVarcharTbl UDF. And the new STRTOK consumes  less CPU than that.
Btw, this query only extract the position of the underscore you still need to extract the following word :-)

SUBSTR(pre.cadena, it.iterador+1, POSITION('_' IN SUBSTR(pre.cadena || '_', it.iterador+1))-1) AS word

Dieter


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>