Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
datatypes

datatypes

Ratings: (0)|Views: 19|Likes:
Published by api-3737640

More info:

Published by: api-3737640 on Oct 16, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

Datatypes Used in Oracle 9i
(2003-04-30) - Contributed by Ben Shepherd
For those who use databases but are not familar to the Oracle 9i database, perhaps you should read about the datatypes
used in Oracle 9i and how they can be used to support object orientation.

It is assumed that you have read my previous Oracle article based on creating an Oracle database in the latest Oracle database 9i. Before we can create a table, one should sit down and take the time to get to know the datatypes available for Oracle. \ue000

\ue000Also, upon reading articles relating to the Oracle database, you should have come across the term Abstract datatypes.

This article will discuss abstract datatypes in depth so that creating a table, which is designed to include abstract
datatypes, will inevitably become more understandable. These abstract datatypes, which I like to call user-defined types,
are datatypes that behave like objects.{mospagebreak title=The Article&toc=1}

Oracle Datatypes\ue000

\ue000These Oracle datatypes are as follows:\ue000
\ue000Character Strings\ue000
\ue000\ue000

- CHAR (size) \u2013 A fixed-sized\ue001field of characters. The largest this particular datatype can become is 2000 bytes. In other words, it can only hold 2000 characters. If you don\u2019t specify the length of the CHAR datatype, the default size is a single character (i.e. 1 byte).\ue000

\ue000\ue000
- NCHAR (size) \u2013 A fixed-sized\ue001field of characters, where the character set is determined by its definition. So, the
maximum size is 2000 bytes per row or 2000 characters. This handles multibyte character sets.\ue000
\ue000\ue000
- VARCHAR2 (size) \u2013 A variable-sized\ue001field of characters. The largest this datatype can become is 4000 characters.\ue000
\ue000\ue000
- NVARCHAR2 (size) \u2013 A variable-sized\ue001field of characters, where the character set is determined by its definition. The
maximum size is 4000 bytes per row or 4000 characters. This handles multibyte character sets.\ue000
\ue000Note: The VARCHAR2 datatype is the successor of VARCHAR. So it is recommended that you use VARCHAR2 as a
variable-sized array of characters.\ue000
http://www.devarticles.com - Dev Articles
Powered by Mambo Open Source
Generated: 8 November, 2004, 21:24
\ue000\ue000
- LONG \u2013 A variable-sized\ue001field of characters. The maximum size of this field is 2GB.\ue000
\ue000\ue000Number\ue000
\ue000\ue000

- NUMBER (precision, scale) \u2013 A variable-sized number, where the precision is between 1 and 38 and size is between -
84 and 127. A NUMBER datatype with only one parameter is NUMBER (precision), where the parameter specifies the
precision of the number. A NUMBER datatype with no parameters is set to its maximum size.\ue000

\ue000\ue000Date and Time\ue000
\ue000\ue000
- DATE \u2013 A fixed-sized 7 bit field that is used to store dates. One thing to note is that the time is stored as part of the
date. The default format DD-MON-YY can be overridden by NLS_DATE_FORMAT.\ue000
\ue000\ue000

- TIMESTAMP (precision) \u2013 A variable-sized value ranging from 7 to 11 bytes, that is used to represent a date/time
value. It includes both date and time. The precision parameter determines how many numbers are in the fractional part of
SECOND field. The precision of the SECOND field within the TIMESTAMP value may have a value ranging from 0 to 9
with a default precision of 6.\ue000

\ue000\ue000

- TIMESTAMP (precision) WITH TIME ZONE \u2013 A fixed-sized value of 13 bytes, which represents a date/time value along with a time zone setting. There are two ways one can set the time zone. The first is by using the UTC offset, say \u2018+10:0\u2019, or secondly by the region name, say \u2018Australia/Sydney\u2019.\ue000

\ue000\ue000

- TIMESTAMP (precision) WITH LOCAL TIME \u2013 A variable value ranging from 7 to 11 bytes. This particular datatype is
similar to the TIMESTAMP WITH TIME ZONE datatype. The difference is that the data is normalised to the database
time zone when stored. The entry is manipulated to concur with the client\u2019s time zone when retrieved.\ue000

\ue000Intervals\ue000
\ue000http://www.devarticles.com - Dev Articles
Powered by Mambo Open Source
Generated: 8 November, 2004, 21:24

\ue000
- INTERVAL DAY (day_precision) TO SECOND (second_precision) \u2013 A fixed-sized 11 byte value that represents a
period of time. It includes days, hours, minutes and seconds.\ue000

\ue000\ue000
- INTERVAL YEAR (year_precision) TO MONTH - A fixed-sized 5 byte value that represents a period of time. It
includes years and months.\ue000
\ue000Binaries\ue000
\ue000\ue000
- RAW (size) \u2013 A variable-sized field of raw binary data. The maximum size for this datatype is 2000 bytes.\ue000
\ue000\ue000
- LONG RAW - A variable-sized field of raw binary data. The maximum size for this datatype is 2 GB.\ue000
\ue000\ue000
- BLOB \u2013 The Binary Large Object is a field that holds unstructured binary data. The maximum size for this datatype is 4
GB.\ue000
\ue000\ue000
- CLOB \u2013 The Character Large Object is a field that holds single byte character data. The maximum size for this
datatype is 4 GB.\ue000
\ue000\ue000
- NCLOB \u2013 The National Character Large Object is a field that holds either single byte of multibyte character data
dependent on the national character set. The maximum size for this datatype is 4 GB.\ue000
\ue000\ue000
- BFILE \u2013 An external binary file. The maximum size for this file is 4 GB. The size is also limited by the operating system.\ue000
\ue000Rows\ue000
\ue000\ue000
- ROWID \u2013 A datatype that contains binary data that is used to identify a row. \ue000
Each ROWID is:\ue000
\ue000\ue000
- 6 bytes for normal indexes on non-partitioned tables, local indexes on partitioned tables and row pointers for
http://www.devarticles.com - Dev Articles
Powered by Mambo Open Source
Generated: 8 November, 2004, 21:24

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->