Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL RPAD Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

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      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 166 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?