Data Types in Oracle 11g

Saturday 4 June 2011

Share this history on :
by : Yuafanda Kholfi Hartono

Data type is a classification or type of information or specific data.
Each value manipulated by Oracle has a data type of each. Data type of a value associated with property values ​​that set fixed. This property causes the values ​​of one data type to be treated different from other values ​​by Oracle.

For example, you can add the value of NUMBER data type, but can not do the same thing on RAW data type. When you create a table or cluster, you must specify the data type for each column. When you create a procedure or function which then will be saved, you must specify the data type for each argument. This data type will determine the domain value in each column that contains the arguments each of which can have the procedure or function. For example, DATE columns can not accept the value February 29 (except for leap year) or the values ​​2 or 'shoes'. Each value will be placed in a column by assuming the data type of column. For example, if
You enter the '01-JAN-98 'into a DATE column, then Oracle treats the character string '01-JAN-98' as a DATE value after verifying the character string has been translated into a valid date format.

Oracle Database provides a number of built-in data types as well as several categories for user-defined types, which can be used as a data type. Explanation of the Oracle data type of each type of data will be described in the following sections:

Character Data Type
Character data type consists of data types CHAR, NCHAR, NVARCHAR2, VARCHAR2, VARCHAR, LONG, RAW and LONG RAW. Explanation of each data type is described as follows:

CHAR
CHAR data type is specified in a character string that has a fixed length. Oracle ensures that all values ​​stored in a CHAR column has a length which is determined by the size (size). If you enter a value shorter than the column length, Oracle will fill in the blank value for the length of column values ​​that are not filled. If you try to enter a value that is too long for the column, Oracle will display an error message.

NCHAR
NCHAR data type is Unicode-only data type. When you create a table with NCHAR columns, you will be asked to specify the column width in characters. You define the national character when you make (create) your database.

NVARCHAR2
The data type NVARCHAR2 are Unicode-only data type. When you create a table with NVARCHAR2 column, you will be asked to include the maximum number of characters that can be loaded into it. Oracle then store each value in the column exactly as you specify it, provided the value does not exceed the maximum length of the column.

VARCHAR2
VARCHAR2 data type to set the variable-length character string. When you create a VARCHAR2 column, you will be asked to include the maximum number of bytes or characters of data that can be loaded into it. Oracle then store each value in the column exactly as you specify it, provided the value does not exceed the maximum length of a column about columns. If you try to enter a value that exceeds the specified length, then Oracle will display an error message.

VARCHAR
Do not use the VARCHAR data type. Use the VARCHAR2 instead. Although VARCHAR data type is currently synonymous with VARCHAR2, VARCHAR data type is scheduled to be redefined as a separate data type used for variable-length character strings compared with different comparison semantics.

LONG
Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB, BLOB) instead. LONG columns are supported only for compatibility. LONG columns store character strings that contain variable-length up to 2
gigabyte -1 or 231-1 bytes. LONG columns have many characteristics of VARCHAR2 columns. You can use LONG columns to store long text strings. The length of LONG values ​​may be limited by the available memory on your computer.

RAW and LONG RAW
Data types RAW and LONG RAW data stores that do not explicitly converted by
Oracle Database when transferring data between different systems. This data type
intended for binary data or byte strings. For example, you can use
LONG RAW to store graphics, sound, documents, or arrays of binary data, which
interpretation depends on the use of each.
Thank you for visited me, Have a question ? Contact on : vandtransformation@gmail.com
Please leave your comment below. Thank you and hope you enjoyed...

0 Comments:

Post a Comment