Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 11 Apr 2011 @ 13:21:39 GMT


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


Subj:   Re: SUBSTR function and logonsource
 
From:   Tewksbury, Kevin

Haha! I misunderstood the question, but that is nothing new...

I take it that you are trying to pull the id from the logonsource. We have found that it does not always start in the same position, but if yours happens to and you are sure every id begins in position 55 and position 55 does not have a blank, then you can try and use the position parameter to find the space at the end of your substring.

     SEL
     .
     .
     .
     ,SUBSTRING(c.userid FROM 1 FOR POSITION (' ' IN c.userid)) AS "User_id"
     .
     .
     FROM
     (
     SEL
     .
     .
     .
     ,SUBSTR(b.logonsource,55,17) AS "UserID"
     .
     .
     FROM  dbc.AccessLog a,
       dbc.LogOnOff b
     ) c

Kevin R Tewksbury
Sr. Database Administrator
LimitedBrands
Limited Technology Services



     
  <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: 15 Jun 2023