Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Mon, 11 Apr 2005 @ 09:51:24 GMT





     
  <Prev Next>   <<First <Prev
Next>
Last>>
 




Subj:   Re: Extracting piece of data from a string of text
 
From:   Allan Holmes



You can also extract the string if you don't know its length by determing the length of the field.

Ie

     cast(SUBSTRING(sub01.temp01 FROM POSITION(' ' IN sub01.temp01) + 1 FOR
     CHARACTER(sub01.temp01) - (POSITION(' ' IN sub01.temp01))) as int) as
     DerivedFieldName

I use this when extracting Stock figures where I concatenate transaction date & time & soh, then strip out the soh data. I also use it for extracting names, suburbs, post-codes etc etc. However, the down-side is, you can only use it if there is no trailing data





     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008