rpad
Syntax
rpad varname desiredlength paddingstring
Description
The RPAD
command acts like the SQL function
RPAD()
with some limitations:
-
The desired length is in bytes, not characters.
-
The padding string is not expanded for string literal escapes, such as unicode escapes.
-
The padding string can contain partial unicode characters or full unicode characters and it may split the padding string in the middle of a multibyte character or surrogate pair.
Only variables that are character based (CHAR
,
VARCHAR
) can be padded with the RPAD
command.
Examples
Command> var myvar varchar2(200) := 'Hi There'; Command> rpad myvar 50 'Timesten'; Command> print myvar; MYVAR : Hi ThereTimestenTimestenTimestenTimestenTimestenTi