Database Reference
In-Depth Information
If you look in the Figure 2-13, especially on the syntax of
CREATE TABLE statement, there is something mentioned
“datatype” besides table name (which will be the name of the
table that you want to create) and the columns names (which will
be the names of the columns that you want to be in the table).
While creating table you also have to tell Oracle what type of
data goes in each column or in other words data type of each
column e.g., if you tell Oracle that I want to store “date” type of
information in first column and “text” type of information in
second column then while inserting data into this table using the
INSERT statement you cannot insert number or currency like
information in first column. If you do so, you will get “type
miss-match” like error. Now let's see what different types of
“Data Types” are available in Oracle so we can utilize them in
the data type assignment of each column within a table in the
CREATE TABLE statement.
A fixed-sized field of characters. Max 2000
bytes/characters.
CHAR (size)
VARCHAR2
(size)
A variable-sized field of characters. Max
4000 bytes/characters.
A variable-sized field of characters. Max
2GB.
LONG
A variable-sized number. A NUMBER
datatype with only one parameter is
NUMBER (precision), where the
parameter specifies the precision of the
number. The precision can range from 1 to
38 and the scale can range from -84 to 127.
A NUMBER datatype with no parameters
is set to its maximum size.
NUMBER
(precision, scale)
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.
DATE
A variable-sized field of raw binary data.
Max 2000 bytes.
RAW (size)
A variable-sized field of raw binary data.
Max 2 GB.
LONG RAW
Search WWH ::




Custom Search