Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Tue, 05 Apr 2005 @ 19:22:06 GMT





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




Subj:   Re: How to simulate built in function RPAD of Oracle in Teradata
 
From:   Michael Larkins



Shaju:

I think that if I needed the RPAD functionality I would do the following:

     SELECT
        char_column||'XXXXXXXXXXXXXXXXXXXX' (char(40))

Now, the number of characters you use in the literal would be equal to the maximum you might ever need based on the shortest possible length of the original data and the size of the resulting column. Then the (char(40)) that I used here is strictly a number like 40, but yours would be the longest allowable length for your column.

An LPAD would require more sophisticated logical to incorporate a specific number of pad characters based on the length of the original data.

Hope this helps,


Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor





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