Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 06 Aug 2004 @ 19:46:08 GMT


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


Subj:   Re: LPAD functionality
 
From:   Dieter Noeth

Donald Iuppa wrote:

  My exact problem is to convert an integer to a string with zero padding for a given length.  


The solution in that special case is not LPAD, but FORMAT:

     select 1234 (format '9(8)') (char(8));

       *** Query completed. One row found. One column returned.
       *** Total elapsed time was 1 second.

     1234
     --------
     00001234


     format '9(8)' = format '99999999' = 8 digits with leading zeroes

Check the manual: SQL Reference Data Types and Literals -> Output Format Phrases


Dieter



     
  <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