RPAD

The Oracle and PLSQL RPAD function pads the right-side of a string with a specific set of characters (when string1 is not null).

The general format is:

RPAD(char1, n [,char2])

Example 1:

SELECT RPAD('JOHN WILLIAMS',20) FROM DUAL;

returns:

JOHN WILLIAMS

Example 2:

SELECT RPAD('JOHN WILLIAMS',20,'-') FROM DUAL;

returns:

JOHN WILLIAMS-------