When you create a table in Oracle, a few items should be important, not only do you have to give each table a name(e.g. employee, customer), you must also list all the columns or fields (e.g. First_name, Mname, Last_name) associated with the table. You also have to specify what type of information that table will hold to the database. For example, the column Empno holds numeric information. An Oracle database can hold many different types of
Data type Description
Char(Size) Stores fixed-length character data to store alphanumeric values, with a maximum size of 2000 bytes. Default and minimum size is 1 byte.
Varchar2(Size) Stores variable-length character data to store alphanumeric values, with maximum size of 4000 bytes.
Nchar(Size) Stores fixed-length character data of length size characters or bytes, depending on the choice of national character set. Maximum size if determined by the number of bytes required storing each character with an upper limit of 2000 bytes. Default and minimum size is 1 character or 1 byte, depending on the character set.
Nvarchar2(Size) Stores variable-length character string having maximum length size characters or bytes, depending on the choice of national character set. Maximum size is determined by the number of bytes required to store each character, with an upper limit of 4000 bytes.
Long Stores variable-length character data up to 2GB(Gigabytes). Its lenth would be restricted based on memory space available in the computer.
Number [p,s] Number having precision p and scale s. The precision p indicates total number of digit varies from 1 to 38. The scale s indicates number of digit in fraction part varies from –84 to 127.
Date Stores dates from January 1, 4712 B.C. to December 31, 4712 A.D. Oracle predefine format of Date data type is DD-MON-YYYY. Raw(Size) Stores binary data of length size. Maximum size is 2000 bytes. One must have to specify size with RAW type data, because by default it does not specify any size.
Long Raw Store binary data of variable length up to 2GB(Gigabytes).
LOBS – LARGE OBJECTS
LOB is use to store unstructured information such as sound and video clips, pictures upto 4 GB size.
CLOB A Character Large Object containing fixed-width multi-byte characters. Varying- width character sets are not supported. Maximum size is 4GB.
NCLOB A National Character Large Object containing fixed-width multi-byte characters. Varying-width character sets are not supported. Maximum size is 4GB. Stores national character set data.
BLOB To store a Binary Large Object such a graphics, video clips and sound files. Maximum size is 4GB.
BFILE Contains a locator to a large Binary File stored outside the database. Enables byte stream I/O access to external LOBs residing on the database server. Maximum size is 4GB.
Apart from oracle internal data types, user can create their own data type, which is used in database and other database object. We will discuss it in the later part.
Data type Description
Char(Size) Stores fixed-length character data to store alphanumeric values, with a maximum size of 2000 bytes. Default and minimum size is 1 byte.
Varchar2(Size) Stores variable-length character data to store alphanumeric values, with maximum size of 4000 bytes.
Nchar(Size) Stores fixed-length character data of length size characters or bytes, depending on the choice of national character set. Maximum size if determined by the number of bytes required storing each character with an upper limit of 2000 bytes. Default and minimum size is 1 character or 1 byte, depending on the character set.
Nvarchar2(Size) Stores variable-length character string having maximum length size characters or bytes, depending on the choice of national character set. Maximum size is determined by the number of bytes required to store each character, with an upper limit of 4000 bytes.
Long Stores variable-length character data up to 2GB(Gigabytes). Its lenth would be restricted based on memory space available in the computer.
Number [p,s] Number having precision p and scale s. The precision p indicates total number of digit varies from 1 to 38. The scale s indicates number of digit in fraction part varies from –84 to 127.
Date Stores dates from January 1, 4712 B.C. to December 31, 4712 A.D. Oracle predefine format of Date data type is DD-MON-YYYY. Raw(Size) Stores binary data of length size. Maximum size is 2000 bytes. One must have to specify size with RAW type data, because by default it does not specify any size.
Long Raw Store binary data of variable length up to 2GB(Gigabytes).
LOBS – LARGE OBJECTS
LOB is use to store unstructured information such as sound and video clips, pictures upto 4 GB size.
CLOB A Character Large Object containing fixed-width multi-byte characters. Varying- width character sets are not supported. Maximum size is 4GB.
NCLOB A National Character Large Object containing fixed-width multi-byte characters. Varying-width character sets are not supported. Maximum size is 4GB. Stores national character set data.
BLOB To store a Binary Large Object such a graphics, video clips and sound files. Maximum size is 4GB.
BFILE Contains a locator to a large Binary File stored outside the database. Enables byte stream I/O access to external LOBs residing on the database server. Maximum size is 4GB.
Apart from oracle internal data types, user can create their own data type, which is used in database and other database object. We will discuss it in the later part.
No comments:
Post a Comment