RPAD

Purpose

This function returns a string of the length n, which is string, filled from the right with expression padding.

Syntax

rpad::=

Usage Notes

  • If the parameter padding is not specified, spaces are used.
  • If the string is longer than n characters, then the first n characters of the string are returned
  • Even if n is greater than 2,000,000, the result string is truncated to 2,000,000 characters.
  • For filling a string from the left, please refer to function LPAD.

Example

SELECT RPAD('abc',5,'X');