Skip Headers
Oracle® OLAP DML Reference
11g Release 2 (11.2)

Part Number E17122-05
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Go to next page
View PDF


The LPAD function returns an expression, left-padded to a specified length with the specified characters; or, when the expression to be padded is longer than the length specified after padding, only that portion of the expression that fits into the specified length.

To right-pad a text expression, use RPAD.

Return Value

TEXT or NTEXT based on the data type of the expression you want to pad (text-exp).


LPAD (text-exp , length [, pad-exp])



A text expression to pad.


The total length of the return value as it is displayed on your screen. In most character sets, this is also the number of characters in the return value. However, in some multibyte character sets, the display length of a character string can differ from the number of characters in the string.

When you specify a value for length that is shorter than the length of text-exp, then this function returns only that portion of the expression that fits into the specified length.


A text expression that specifies the padding characters. The default value of pad-exp is a single blank.


Example 8-17 Left-Padding a String

The following example left-pads a string with the characters "*" and ".".

SHOW LPAD('Page 1',15,'*.') 
*.*.*.*.*Page 1