The RPAD function adds the first character of the specified padding to the end of the string until the source string becomes the specified length.
If the padding is more than one character long, only the first character is used. If the padding is zero length, no padding is added.
If the source is a string, and the padding is not specified, a space is used for padding. If the source is a number and padding is not specified, a zero is used for padding.
The RPAD function has the following format:
RPAD(source_string|number, length[, padding])
The RPAD function accepts the following parameters:
source_string (string)
This parameter can be a number; it is converted to a string.
length (number)
padding (string)
(Optional)
The RPAD function returns a string.
Return_value=RPAD('Juan', 5)
Return_value='Juan '
Return_value=RPAD('Juan', 5, 'X')
Return_value='JuanX'
Return_value=RPAD('Juan', 6, 'XY')
Return_value='JuanXX'
Return_value=RPAD(5, 2)
Return_value='50'
Return_value=RPAD(5, 2, ' ')
Return_value='5 '
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |