Quick Search:
 
 The Oracle PL/SQL RPAD Function      [Return To Index] Jump to:  

Term: RPAD

Definition:
In Oracle PL/SQL, RPAD is a built in function which pads the input string with extra characters from the right side. It accepts three arguments: the input string, the net length of the string including padding, and the character to be used for padded. Note that the third argument is optional. If it is not provided, Oracle will use blank spaces as the default padding character.

Example Syntax:

RPAD (input_string, length, padding_character)


Example Usage:

The SQL query below pads the string 'PSOUG' with the character 'X' up to 10 characters.

SQL> SELECT RPAD('PSOUG',10,'X') FROM DUAL;
PSOUGXXXXX


The SQL query shows that the padded length takes precedence over the actual length of the original string.

SQL> SELECT RPAD('PSOUG', 3) FROM DUAL;
PSO



Related Links:

Related Code Snippets:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org