Friday, December 30, 2016

Datatypes: in oracle dbms

Datatypes:

------------------------------------------------------------------------------------------------------------------
1. Built-In Data Type:
Data type represents the type of data into a column based on data type, oracle engine allocates required memory for each value and the column.

A. String datatypes:

CHAR(size): to store fixed length char value.
   by default size is 1 char and Max size is 2000 char.

VARCHAR2(size): to store variable length char values & no minimum size, in this case, we                               must specify size.
Max size is 4000 char(upto 11g)
Max size is 32000 char(from 12c)

NCHAR(size): to store fixed length unicode character

NCHAR2(size): to store variable length unicode character.

LONG: it is similar to varchar2 datatype but max size is 2GB.

2. Numerical Data Type:
TO store Number type Data.

Number(precesion): it will store numeric values without decimal point. precesion represent                                       Max no of digit in the value.
Max value of precesion is 38 digits.

Number(precesion, scale): to store values with decimal point, scale represents max no of digits                               after decimal point.
                      EX: emp number(5)
                     prod_price(7,2)

3. Date Data Type:

Date: To store date type data.
Oracle system defined date format as
DD-MON-YY
DD- Date Digits
MON- First three char of month
YY - last 2 digits of year

Current_TimeStamp: to store date value, along with time format.
DD-MON-YY HH:MM:SS AM/PM

4. Binary Data Types:
Binary data type means unstructured data like images, digital signatures, thumb impressions, audio & video files.

RAW(size): max size 2000 bytes.
LONGRAW(size): max size 2GB.

5. LOB Data Types: (Large Objects)
to store large objects having more size then 2GB & max size is 4 GB.
CLOB: char LOB
BLOB: binary LOB
NCLOB: multi character LOB

6. ROWID: maintain physical address of each record.

7. Bfile: It is a pointer to a Binary File.

You may also like:
-->  Type Casting in JAVA
--> Data Type in JAVA

No comments:

Post a Comment