Teradata RPAD - Right Padding

access_time 15 days ago visibility7 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');

Result:

'12345678900000000000000'

Omit fill_string parameter

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

Example:

SELECT RPAD('123456789',23);

Result:

'123456789              '
info Last modified by Administrator at 15 days 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 SQL local_offer SQL Server local_offer t-sql local_offer teradata local_offer teradata-sql-query

visibility 41908
thumb_up 0
access_time 6 years ago

SELECT is one of the most commonly used statements. In this tutorial, I will cover the following items: Two of the principal query clauses—FROM and SELECT Data Types Built-in functions CASE expressions and variations like ISNULL and COALESCE. * The functio...

local_offer teradata local_offer SQL

visibility 606
thumb_up 1
access_time 11 months ago

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

local_offer hive local_offer SQL local_offer hive-sql-ddl

visibility 12
thumb_up 0
access_time 27 days ago

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

About column

Teradata

Tutorials and information about Teradata.

rss_feed Subscribe RSS