Archives of the TeradataForum
Message Posted: Fri, 06 Aug 2004 @ 19:46:08 GMT
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
|