RPAD Function
The RPAD function pads the right side of a string with the specified string. Every character in
the string, including multibyte characters, is treated as one character.
RPAD is a Neoview extension.
RPAD (str, len [,padstr])
str
can be an expression. See
len
identifies the desired number of characters to be returned and can be an expression but must
be an integral value. If len is equal to the length of the string, no change is made. If len is
smaller than the string size, the string is truncated.
pad-character
can be an expression and may be a string.
Examples of RPAD Function
•
This function returns 'kite
rpad('kite', 7)
•
This function returns 'ki':
rpad('kite', 2)
•
This function returns 'kite0000':
rpad('kite', 8, '0')
•
This function returns 'go fly a kite':
rpad('go fly a kite', 13, 'z')
•
This function returns 'go fly a kitez'
rpad('go fly a kite', 14, 'z')
•
This function returns 'kitegoflygoflygof':
rpad('kite', 17, 'gofly' )
454
SQL Functions and Expressions
"Character Value Expressions" (page
':
255).