LFILL(x,a,n) is a string function that inserts the character string a (string literal) at the start of the character string x (string specification) as often as required until the character string has reached the length n (unsigned integer). Only expressions that supply an alphanumeric value are permitted as string specifications.
If the character string a cannot be completely inserted without exceeding the specified total length, only the part that is needed to reach the total length is inserted.
|
Result of the LFILL(x,a,n) Function |
LFILL(x,a) |
The column x is filled with the characters of a until its maximum length is reached. |
x is a NULL value |
NULL value |
a or n is the NULL value |
Error message |
SELECT LFILL (firstname,'*',10) firstname, name
FROM customer
WHERE firstname IS NOT NULL
FIRSTNAME |
NAME |
*****Jenny |
Porter |
*****Peter |
Brown |
******Rose |
Brian |
*****Mary |
Griffith |
****Martin |
Randolph |
*****Sally |
Smith |
******Mike |
Jackson |
******Rita |
Doe |
****George |
Howe |
*****Frank |
Miller |
*****Susan |
Baker |
****Joseph |
Peters |
****Antony |
Jenskins |
See also: