Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What is the syntax for rpad in plsql?


Asked by Cecelia Hanna on Dec 09, 2021 FAQ



The syntax for the RPAD function in Oracle/PLSQL is: RPAD ( string1, padded_length [, pad_string] )
Just so,
The RPAD function in PLSQL is useful for formatting the output of a query. The RPAD function accepts three parameters which are input_string, padded_length and the pad_string. Both input_string and pad_string can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.
Consequently, If the padded_length is smaller than the original string, the RPAD function will truncate the string to the size of padded_length. Optional. This is the string that will be padded to the right-hand side of string1. If this parameter is omitted, the RPAD function will pad spaces to the right-side of string1. The RPAD function returns a string value.
Similarly,
pad_string – It is an optional parameter which is used to specify the input_string that will be padded to the left-hand side of string. If this parameter is omitted, the LPAD function will pad spaces to the left-side of string1. Supported Versions of Oracle/PLSQL: Oracle 12c
Likewise,
The Oracle/PLSQL LPAD function adds a certain set of characters from the left side of the string (at non-zero string1). string1_id – string for adding characters (on the left side). padded_length_id – number of characters to be added.