일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- jquery
- 이클립스
- 날짜
- 오라클
- php
- 톰캣
- HTML5
- MYSQL
- 전자정부 표준프레임워크
- RADIO
- @RequestBody
- html
- 웹 플랫폼 설치 관리자
- 네이버스마트 에디터
- exception
- 문자열
- JSTL
- maven
- json
- spring form tag
- java
- Oracle
- SSL
- DB
- 호환성
- 한글
- checbox
- switch
- 스크립트
- null
- Today
- Total
개인적인 정리
[Oracle] LPAD() 본문
오라클 LPAD()
LPAD()
-
LPAD(expr1, n)
LPAD(expr1, n, expr2)
의 형태
LPAD returns expr1, left-padded to length n characters with the sequence of characters in expr2. This function is useful for formatting the output of a query.
Both expr1 and expr2 can be any of data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is of VARCHAR2 data type if expr1 is a character data type, NVARCHAR2 if expr1 is a national character data type, and a LOB if expr1 is a LOB data type, The string returned is in the same character set as expr1. The argument n must be a NUMBER interger or a value that can be implicitly converted to a NUMBER integer.
If you do not specify expr2, then the default is a single blank. If expr1 is longer than n, then this function returns the position of expr1 that fits in n.
The argument n is the total length of the return value as it is displayed on your terminal screen. In most character sets, this is also the number of characters in the return value. Howerer, in some multibyte character sets, the display length of a character string can differ from the number of characters in the string.
SQL>SELECT LPAD('Page 1', 15, '*.') FROM DUAL;
--> *.*.*.*.*Page 1
SQL>SELECT LPAD('Page 1', 15) FROM DUAL;
--> Page 1
* expr2가 없으면 blank로 채워진다.
'DB > ORACLE' 카테고리의 다른 글
[Oracle] MIN() (0) | 2020.04.09 |
---|---|
[Oracle] MEDIAN() (0) | 2020.04.09 |
[Oracle] MAX() (0) | 2020.04.09 |
[Oracle] LTRIM() (0) | 2020.04.08 |
[Oracle] LOWER() (0) | 2020.04.08 |
[Oracle] LOG() (0) | 2020.04.08 |
Oracle LOCALTIMESTAMP() (0) | 2020.04.08 |
Oracle LNNVL() (0) | 2020.04.08 |