Teradata RPAD - Right Padding

access_time 3 months ago visibility53 comment 0

Teradata RPAD function is used to add repeated characters at the end of a string to increase the string to a specified length. It can be used to add trailing space or zeros to a string.

RPAD function signature 

RPAD(source_string, length, fill_string)

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

Pad with trailing zeros

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



Omit fill_string parameter

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


SELECT RPAD('123456789',23);


'123456789              '
info Last modified by Administrator at 3 months 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

Kontext Column

Created for everyone to publish data, programming and cloud related articles.
Follow three steps to create your columns.

Learn more arrow_forward

More from Kontext

local_offer teradata local_offer SQL

visibility 1382
thumb_up 1
access_time 2 years ago

This code snippet shows how to convert string to date in Teradata.

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 354
thumb_up 0
access_time 4 months ago

In article   Teradata SQL - Use OREPLACE to Replace or Remove Characters , it shows how to use OREPLACE function in Teradata to replace or remove strings. This page will show one more alternative way of doing that using regular expressions. select oreplace('Kontext is a website for data ...

local_offer hive local_offer SQL local_offer hive-sql-ddl

visibility 92
thumb_up 0
access_time 4 months ago

This page shows how to create a managed(internal) Hive table from a SELECT statement via Hive SQL (HQL). Example: CREATE TABLE IF NOT EXISTS hql.transactions_copy STORED AS PARQUET AS SELECT * FROM hql.transactions; A MapReduce job will be submitted to create the table from SELECT statement.

About column

Tutorials and information about Teradata.

rss_feed Subscribe RSS