RPAD: Right-Padding a Character String

How to:

Reference:

RPAD uses a specified character and output length to return a character string padded on the right with that character.


Top of page

x
Syntax: How to Pad a Character String on the Right
RPAD(string, out_length, pad_character) 

where:

string

Alphanumeric

Is a string to pad on the right side.

out_length

Integer

Is the length of the output string after padding.

pad_character

Alphanumeric

Is a single character to use for padding.



Example: Right-Padding a String

RPAD right-pads the PRODUCT_CATEGORY column with @ symbols:

RPAD(PRODUCT_CATEGORY,25,'@')

For Stereo Systems, the output is Stereo Systems@@@@@@@@@@@.


Top of page

x
Reference: Usage Notes for RPAD

iWay Software