Oracle/plsql:lpad Function-from Cyber

Source: Internet
Author: User
Tags function examples

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.