Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 21 Aug 2004 @ 15:51:26 GMT


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


Subj:   Re: Specifying pad character (other than space) in FORMAT
 
From:   Judge, James A

If you are on R5.1 then you could possibly get the defined UDF for LPAD from your account support. If you wanted to do this in SQL, let's see:

LPAD is to "left pad" (i.e. before the character string (Y/N?) )so if your source column is SOURCECHAR and your target is of x length, then

CAST ( subtring('padcharacterstring',1,CHARACTER_LENGTH (TRIM (LEADING FROM
SOURCECHAR)) )||TRIM (BOTH FROM SOURCECHAR)) as CHAR(x)
     )

Haven't even desk checked this much less tested so not sure; but the 1st "....CHARACTER_LENGTH (TRIM (LEADING..." might need to be the Teradata CHARACTERS and TRIM BOTH .. but just a guess.



     
  <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