3
Copyright © 2004, Oracle. All rights reserved.
Using Single-Row Functions to
Customize Output
3-2
Copyright © 2004, Oracle. All rights reserved.
Objectives
After completing this lesson, you should be able to do
the following:
•
Describe various types of functions that are
available in SQL
•
Use character, number, and date functions in
SELECT statements
•
Describe the use of conversion functions
3-3
Copyright © 2004, Oracle. All rights reserved.
SQL Functions
Function
Input
arg 1
arg 2
arg n
Function performs
action
Output
Result
value
3-4
Copyright © 2004, Oracle. All rights reserved.
Two Types of SQL Functions
Single-row
functions
Multiple-row
functions
Return one result
per row
Return one result
per set of rows
Functions
3-5
Copyright © 2004, Oracle. All rights reserved.
Single-Row Functions
Single-row functions:
•
Manipulate data items
•
Accept arguments and return one value
•
Act on each row that is returned
•
Return one result per row
•
May modify the data type
•
Can be nested
•
Accept arguments that can be a column or an
expression
function_name [(arg1, arg2,...)]