Neoview SQL Reference Manual (R2.3)

LPAD Function
The LPAD function pads the left side of a string with the specified string.
LPAD is a Neoview extension.
LPAD (str, len [,padstr])
str
can be an expression. See “Character Value Expressions” (page 218).
len
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 LPAD
This function returns ' kite':
lpad('kite', 7)
This function returns 'ki':
lpad('kite', 2)
This function returns '0000kite':
lpad('kite', 8, '0')
This function returns 'go fly a kite':
lpad('go fly a kite', 13, 'z')
This function returns 'John,John, go fly a kite'':
lpad('go fly a kite', 23, 'John,')
370 SQL Functions and Expressions