Teradata LPAD - Left Padding

visibility 3,758 access_time 2 years ago languageEnglish timeline Stats
timeline Stats
Page index 5.68

Teradata LPAD function is used to add repeated characters at the beginning of a string to increase the string to a specified length. It can be used to add leading space or zeros to a string.

LPAD function signature 

LPAD(source_string, length, fill_string)

Returns the source_string padded to the left with the characters in fill_string so that the resulting string is length characters. 

Pad with leading zeros

SELECT LPAD('123456789',23,'0');



Omit fill_string parameter

The last parameter is optional. When it is omitted, the default value is space (' ')


SELECT LPAD('123456789',23);


info Last modified by Administrator 2 years ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
Teradata SQL - LEAD and LAG OLAP Functions
visibility 3,532
thumb_up 0
access_time 3 years ago
How to fetch data from Teradata database? forum
visibility 126
thumb_up 1
access_time 10 months ago