PL/SQL Rpad

The RPAD function returns an right padded expression to a specified length with the specified characters.

Rpad syntax

RPAD( expression, length, [ pad_expression ] ) 

Rpad example

select rpad('learn', 5) from dual;

Result: learn


select rpad('learn', 3) from dual;

Result: lea


select rpad('learn', 6,'0') from dual;

Result: learn0


select rpad('learn', 7,'0') from dual;

Result: learn00


select rpad('learn', 7,'0') from dual;

Result: learn000