LPAD
Syntax
LPAD(expr1, num [, expr2])
Overview
LPAD
is a function that concatenates expr2 to the left of expr1 and returns a string with a length equal to num.
In most character sets, the number of characters in a returned string is the same as its length, but in multi-byte character sets such as Korean, these two values can differ.
Parameter
Parameter
Description
expr1
Arbitrary operation expression that returns a string, CLOB type, or BLOB type. If the length of expr1 is greater than num, returns the string from the left side of expr1 that is equal to num.
expr2
Arbitrary operation that returns a string, CLOB type, or BLOB type. If expr2 is not specified, a space character is used.
num
Arbitrary operation that returns a numeric value. num refers to the length of the output to the terminal.
Example
SELECT LPAD('LPAD', 10, '-=');
lpad
------------
-=-=-=LPAD
(1 row)
Last updated