RPAD()

Overview

Returns a string right-padded with the specified characters.

USAGE

RPAD(string, width, padding)

Argument Name

Description

string

The string to be padded

width

The desired width of the resulting string

padding

The string that is used for padding

DETAILS

RPAD() is a string function that returns the string right-padded in a field of the specified width using the specified padding string.

A string that is longer than the specified width is shortened to fit within the width.

A string that is shorter than the specified width has the beginning of the field with filled in with the padding characters, which are repeated if they are shorter than the needed padding length.

A NULL is returned if any argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT RPAD('Example', 15, ' .') AS result;
+-----------------+
| result          |
+-----------------+
| Example . . . . |
+-----------------+
SELECT RPAD('Example', 2, '~') AS r;
+------+
| r    |
+------+
| Ex   |
+------+
SELECT RPAD('FOO', 42, '_.~"~._.~"~._.~"~._.~"~.') AS result;
+--------------------------------------------+
| result                                     |
+--------------------------------------------+
| FOO_.~"~._.~"~._.~"~._.~"~._.~"~._.~"~._.~ |
+--------------------------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES