posts - 201,  comments - 927,  trackbacks - 0

原文出处:http://mfm088.itpub.net/post/22599/250400
Oracle/PLSQL: Lpad Function

In Oracle/PLSQL, the lpad function pads the left-side of a string with a specific set of characters.

The syntax for the lpad function is:

lpad( string1, padded_length, [ pad_string ] )

string1 is the string to pad characters to (the left-hand side).

padded_length is 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 is 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.

For example:

lpad('tech', 7); would return ' tech'
lpad('tech', 2); would return 'te'
lpad('tech', 8, '0'); would return '0000tech'
lpad('tech on the net', 15, 'z'); would return 'tech on the net'
lpad('tech on the net', 16, 'z'); would return 'ztech on the net'
 
posted on 2007-04-26 11:00 阿蜜果 阅读(336) 评论(0)  编辑  收藏 所属分类: Oracle



标题  
姓名  
主页
验证码 *  
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-01-07 08:47 编辑过
 
 
相关链接:
网站导航:



<2007年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345


錢為人用無需多,人為錢忙凈白忙

留言簿(140)

随笔分类

随笔档案

文章分类

相册

关注blog

积分与排名

  • 积分 - 271485
  • 排名 - 25

最新评论

评论排行榜

60天内阅读排行