Showing posts with label Datatypes in Oracle. Show all posts
Showing posts with label Datatypes in Oracle. Show all posts

Sunday, January 11, 2009

Datatypes available in Oracle.

Five type of Data Type.

1. Character Datatype
2. Numberic Datatype
3. Date/Time Datatype
4. Long Object(LOB) Datatype
5. Rowid Datatype

1. Character Datatype :
char(size) where size is the number of character to store
nchar(size)
varchar2(size)
nvarchar2(size)
long
raw
long raw

2. Numberic Datatype :
number(p,s) Where p is the precision and s is the scale
numberic(p,s)
float
dec(p,s)
decimal(p,s)
integer
int
smallint
real
double preision
3. Date/Time Datatype :
date
timestamp (fractional seconds precision) :

Includes year, month, day, hour, minute, and seconds.
For example:
timestamp(6)

timestamp (fractional seconds precision) with time zone:

Includes year, month, day, hour, minute, and seconds; with a time zone displacement value.
For example:
timestamp(5) with time zone
timestamp (fractional seconds precision) with local time zone :
Includes year, month, day, hour, minute, and seconds; with a time zone expressed as the session time zone.
For example:
timestamp(4) with local time zone
interval year(year precision) to month:
Time period stored in years and months.
For example:
interval year(4) to month
interval day(day precision) to second (fractional seconds precision):
Time period stored in days, hours, minutes, and seconds.
For example:
interval day(2) to second(6)

4. Long Object(LOB) Datatype :
bfile : File locators that point to a binary file on the server file system (outside the database).
blob : Stores unstructured binary large objects.
clob : Stores single-byte and multi-byte character data.
nclob : Stores unicode data.

5. Rowid Datatype
rowid :
The format of the rowid is: BBBBBBB.RRRR.FFFFF Where BBBBBBB is the block in the database file;
RRRR is the row in the block;
FFFFF is the database file

Fixed-length binary data. Every record in the database has a physical address or rowid.

urowid(size) :