Beruflich Dokumente
Kultur Dokumente
Single-Row Functions
Input Output
Function
arg 1 Function
performs action
arg 2
Result
value
arg n
Functions
Single-row Multiple-row
functions functions
Character
General Number
Single-row
functions
Conversion Date
LOWER CONCAT
UPPER SUBSTR
INITCAP LENGTH
INSTR
LPAD
2-7 Copyright Oracle Corporation, 1998. All rights reserved.
Case Conversion Functions
ENAME WEEKS
---------- ---------
KING 830.93709
CLARK 853.93709
MILLER 821.36566
Number of months
MONTHS_BETWEEN between two dates
Add calendar months to
ADD_MONTHS date
Next day of the date
NEXT_DAY specified
• LAST_DAY('01-SEP-95') '30-SEP-95'
• ROUND('25-JUL-95','MONTH') 01-AUG-95
• ROUND('25-JUL-95','YEAR') 01-JAN-96
• TRUNC('25-JUL-95','MONTH') 01-JUL-95
• TRUNC('25-JUL-95','YEAR') 01-JAN-95
Datatype
conversion
NUMBER VARCHAR2
DATE VARCHAR2
TO_CHAR TO_CHAR
TO_CHAR(date, 'fmt')
0-49 50-99
If two digits The return date is in The return date is in
of the 0-49 the current century. the century before
current the current one.
year are The return date is in The return date is in
50-99 the century after the current century.
the current one.
ENAME HIREDATE
---------- -----------------
KING 17 November 1981
BLAKE 1 May 1981
CLARK 9 June 1981
JONES 2 April 1981
MARTIN 28 September 1981
ALLEN 20 February 1981
...
14 rows selected.
SALARY
--------
$3,000
TO_NUMBER(char)
TO_DATE(char[, 'fmt'])
Step 1 = Result 1
Step 2 = Result 2
Step 3 = Result 3
ENAME NVL(TO_CHAR(MGR),'NOMANAGER')
---------- -----------------------------
KING No Manager