Oracle 19c SQL

  1. Home
  2. Docs
  3. Oracle 19c SQL
  4. Single Row Character Functions
  5. RPAD


SELECT RPAD('dcodeman',10,'*') FROM DUAL;
SELECT RPAD('dcodeman',10,'-') FROM DUAL;
SELECT RPAD('dcodeman',10,'*-*') FROM DUAL;
SELECT RPAD('dcodeman',2,'*') FROM DUAL;
SELECT RPAD('dcodeman',-2,'*') FROM DUAL;
SELECT RPAD('dcodeman',0,'*') FROM DUAL;

The 3rd parameter to RPAD is optional. When you don’t specify the 3rd parameter in RPAD, Oracle takes the default parameter as white space.

SELECT RPAD('dcodeman',10) FROM DUAL;

The 1st and 2nd parameter to RPAD are compulsory. If you don’t specify then Optimizer raises error i.e “ORA-00938: not enough arguments for function.

Was this article helpful to you? Yes No

How can we help?