ORACLE_LPAD_FUNCTION
Oracle / PLSQL: LPAD Function
This Oracle tutorial explains how to use the Oracle/PLSQL LPAD function with syntax and examples.
Description
The Oracle/PLSQL LPAD function pads the left-side of a string with a specific set of characters (when 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 will truncate the string to the size of padded_length.
- pad_string
- Optional. This is the string that will be padded to the left-hand side of string1. If this parameter is omitted, the LPAD function will pad spaces to the left-side of string1.
Returns
The LPAD function returns a string value.
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:
table can use dual example.such as select lpad('tech',7) from dual;
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_LPAD_FUNCTION的更多相关文章
随机推荐
- HDU - 2842
要拆第n个环要求保留第n-1拆除前n-2 对于n,先拆掉n-2再去掉n再放回n-2,然后规模降为n-1 f(n)=2f(n-2)+f(n-1)+1 inline ll mod(ll a){return ...
- [转] Spring Integration 系统集成
[From] http://blog.csdn.net/w_x_z_/article/details/53316618 pring Ingegration 提供了基于Spring的EIP(Enterp ...
- Python+Selenium定位元素的方法
Python+Selenium有以下八种定位元素的方法: 1. find_element_by_id() eg: find_element_by_id("kw") 2. find_ ...
- switch case 注意事项+1 及 case合并综合练习例子
case可以合并: 练习11:根据输入的星期,得到具体每天做的事情.星期一学习,星期二学习,星期三自习,星期四学习,星期五自习,星期六学习,星期日学习 class Switch02{ public s ...
- oracle 单实例DG(切换篇三)
一,开篇 此篇操作承接上文,必须完成DG实例搭建完成方可有执行以下内容的实例 二,切换物理备库 one. oracle01库命令 select switchover_status from v$dat ...
- Python-2.7 配置 tab 自动补全功能
作者博文地址:http://www.cnblogs.com/liu-shuai/ 之前一直使用shell编程,习惯了shell的 tab 自动补全功能,而Python的命令行却不支持 tab 自动补全 ...
- vim配置clojure开发环境备忘录
1 需要使用的插件 vundle 使用教程 http://www.cnblogs.com/respawn/archive/2012/08/21/2649483.html vim-fireplace h ...
- nyoj 999——师傅又被妖怪抓走了——————【双广搜】
师傅又被妖怪抓走了 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 话说唐僧复得了孙行者,师徒们一心同体,共诣西方.自宝象国救了公主,承君臣送出城西,沿路饥餐渴饮,悟 ...
- sqlserver 限制用户只能访问指定的视图
项目中有一个需求,要求给其它单位提供数据,我们用到了视图,并要求不能让他们看到数据库中的其它数据,我们为其创建了单独的账号,并只能看到指定视图 一.创建视图 CREATE VIEW [dbo].[v_ ...
- 【学习笔记】实用类String的基本应用即常用方法
一.String类概述 在Java中,字符串被作为String类型的对象来处理. String类位于java.lang包中,默认情况下会自动导入到所有的程序中. 创建String对象的方法如下: St ...