Teradata LPAD - Left Padding

visibility 3,448 access_time 2 years ago languageEnglish

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.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 5.55
More from Kontext
Teradata: Rights Held by Database
visibility 47
thumb_up 0
access_time 2 years ago
Trim Leading or/and Trailing Zeros in Teradata
visibility 7,652
thumb_up 2
access_time 2 years ago
BigQuery MD5, SHA1, SHA256, SHA512 Hash Functions
visibility 251
thumb_up 0
access_time 9 months ago
BigQuery MD5, SHA1, SHA256, SHA512 Hash Functions