Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 30 Apr 2012 @ 10:20:11 GMT


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


Subj:   Extracting a String From End
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, April 30, 2012 02:49 -->

Hi All,

I need help to extract a string, reading it from end.

The problem is:

I have a string like -

     /scm/edw/appl/download/daily/current/DWI.CPC.IRA.RATNG.DAILY

I need to read this string from a table's column.

The string part {/scm/edw/appl/download/daily/current/} may change depending on the path provided.

I need to read the above string from end and move till I encounter the "/" symbol, as it will be last from the start and hence will be getting the string

     {DWI.CPC.IRA.RATNG.DAILY}

I am trying to extract using the SUBSTR, POSITION string functions, but not getting it.

     SEL SUBSTR (, CHARACTER_LENGTH ()-2, POSITION ('/' IN ));

Kindly help.

Thanks.



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016