Oracle/plsql:Lpad Function
This is the Oracle/plsql lpad function with syntax and examples of the Oracle tutorial explains.
Description
The Oracle/plsql lpad function pads The left-side of a string with a specific set of characters if string1 is Not null).
Syntax
The syntax for the Lpad function in Oracle/plsql is:
LPAD( string1, padded_length [, pad_string] )
Parameters or Arguments
-
String1
-
The string to pad characters to (the left-hand side).
-
Padded_length
-
The number of characters to return. If the
padded_length is smaller than the original string, the Lpad function would truncate the string to the SI Ze of
padded_length.
-
Pad_string
-
Optional. This was the string that would be padded to the left-hand side of
string1. If This parameter is omitted, the Lpad function would pad spaces to the left-side of
string1.
Applies To
The Lpad function can be used in the following versions of Oracle/plsql:
- Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
Example
Let's look at some Oracle Lpad function examples and explore how to use the Lpad function in Oracle/plsql.
For example:
LPAD(‘tech‘, 7);Result: ‘ tech‘LPAD(‘tech‘, 2);Result: ‘te‘LPAD(‘tech‘, 8, ‘0‘);Result: ‘0000tech‘LPAD(‘tech on the net‘, 15, ‘z‘);Result: ‘tech on the net‘LPAD(‘tech on the net‘, 16, ‘z‘);Result: ‘ztech on the net‘
Oracle/plsql:lpad Function-from Cyber