Book Contents

Book Index

Next Topic

Home

LPAD

LPAD returns a VARCHAR value representing a string of a specific length filled on the left with specific characters.

Syntax

LPAD( expression, length [ , fill ] )

Semantics

 

expression

(CHAR OR VARCHAR) specifies the string to fill

length

(INTEGER) specifies the number of characters to return

fill

(CHAR OR VARCHAR) specifes the repeating string of characters with which to fill the output string. The default is the space character.

Notes

Examples

> SELECT LPAD('database', 15, 'xzy');

lpad

-----------------

xzyxzyxdatabase

(1 row)