 |
|
Oracle Tips by Burleson |
Functions
In this chapter, we are going to introduce
Oracle’s data types. This defines the set of data that can be
stored in the Oracle database. Next, we will introduce Oracle
functions, starting with single row functions, date functions and
progressing through multi-row functions. Oracle functions provide
an extraordinary capability to manipulate data as it is queried and
returned.
But first, we need to discuss Oracle data
types. Oracle has three basic data types; numbers, characters (or
strings), and dates. Each data type has a different set of
functions for manipulation and conversion.
Oracle Data Types
SQL has several standard data types, and we
need to match the data types when we start writing SQL. In this
section, we will introduce the set of data types that are part of
the Oracle database. These data types are called basic or built-in
data types. As we will see near the end of this section, you can
use these basic data type to create your own data types.
When you create a table, you must define a
data type for each column in that table. For example, here we
define a table with a variable character data type (VARCHAR), a date
data type and a number data type:
create table customer
(
customer_name varchar(50),
birth_date date,
income number
);
The basic Oracle data types fall into the
following categories: character; number; date; LOBs; and RAW. The
two main character data types are the char and the varchar2.
The above book excerpt is from:
Easy Oracle
SQL
Get Started
Fast writing SQL Reports with SQL*Plus
ISBN 0-9727513-7-8
Col. John Garmany
http://www.rampant-books.com/book_2005_1_easy_sql.htm |